Commit Graph

21 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
d90d924c8c Remove parser library_data_pod_t ffi workaround
We don't need to separate POD fields from the main parser libdata any more.
2024-06-02 20:27:44 -05:00
Johannes Altmanninger
d40d2b786f Work around wants_terminal not begin set inside eval
On this binding we fail to disable CSI u

    bind c-t '
        begin
            set -lx FZF_DEFAULT_OPTS --height 40% --bind=ctrl-z:ignore
            eval fzf | while read -l r; echo read $r; end
        end
    '

because for "fzf", ParseExecutionContext::setup_group() returns early with the
parent process group (which should be fish's own) , hence "wants_terminal"
is false. This seems questionable, I don't think the eval should make a
difference here.

For now, don't touch it; use the more accurate way of detecting whether
a process may read keyboard input. In many of such cases "wants_terminal"
is false, like

    echo (echo 1\n2\n3 | fzf)

Fixes #10504
2024-05-18 20:55:06 +02:00
Johannes Altmanninger
29f2da8d18 Toggle terminal protocols lazily
Closes #10494
2024-05-16 12:26:47 +02:00
Mahmoud Al-Qudsi
5f8f799cf7 Replace C++ doc \return with "Return"
quick_replace '\\\\return(s)? ' 'Return$1 ' src/

Filtered to only lines beginning with //
2024-05-06 14:59:36 -05:00
Mahmoud Al-Qudsi
589639a87d Replace C++-style \p with Markdown backticks
quick_replace '\\\\p ([a-zA-Z0-9_]+)' '`$1`' src/

Filtered to only lines beginning with //
2024-05-06 14:59:23 -05:00
Anurag Singh
4fa8d95b98 Move push_timer to measure command substitution timing too 2024-05-03 09:32:26 +02:00
Johannes Altmanninger
fd61bad946 Further simplify terminal_protocols scoping
Remove the last non scoped place where we disable protocols (just before
exec(1)); it's not necessary with the current approach because we always
disable inside eval.
There is an edge case where we don't:

    fish -ic "exec bash"

leaving bash with CSI u enabled.  Disable that also in -ic mode where we
don't have a reader.

In future we should use the same approach for restore_term_mode() but I'm
not sure which one is better.
2024-04-21 21:32:44 +02:00
Johannes Altmanninger
8164855b70 Disable terminal protocols throughout evaluation
Test changes are very hacky, will cleanup later.

Closes #10408
2024-04-02 21:25:47 +02:00
Johannes Altmanninger
8bf8b10f68 Extended & human-friendly keys
See the changelog additions for user-visible changes.

Since we enable/disable terminal protocols whenever we pass terminal ownership,
tests can no longer run in parallel on the same terminal.

For the same reason, readline shortcuts in the gdb REPL will not work anymore.
As a remedy, use gdbserver, or lobby for CSI u support in libreadline.

Add sleep to some tests, otherwise they fall (both in CI and locally).

There are two weird failures on FreeBSD remaining, disable them for now
https://github.com/fish-shell/fish-shell/pull/10359/checks?check_run_id=23330096362

Design and implementation borrows heavily from Kakoune.

In future, we should try to implement more of the kitty progressive
enhancements.

Closes #10359
2024-04-02 14:35:16 +02:00
Mahmoud Al-Qudsi
0ca199ef98 Change wopen_cloexec() to return File 2024-03-23 01:34:23 -05:00
Fabian Boehm
b03e727531 Remove unnecessary formatting 2024-03-09 12:06:24 +01:00
Fabian Boehm
46afbea72b exec: Pass some cstrs as cstr instead of converting to ptr and back 2024-02-16 19:40:41 +01:00
ridiculousfish
5021639db1 Correct some comments and duplicative error messages
If we fail to create a pipe, we will report that fact in multiple places; remove
some redundant error reporting.
2024-02-11 12:16:58 -08:00
PolyMeilex
b9ba9e57e8 Use nix & Results 2024-02-11 11:40:27 -08:00
PolyMeilex
971d774e67 Use OwnedFd in AutoClosePipes 2024-02-11 11:40:27 -08:00
PolyMeilex
6ef8125c96 Return OwnedFd from open_cloexec 2024-01-27 20:42:13 +01:00
PolyMeilex
2512849ece Use nix OFlag for open_cloexec 2024-01-27 20:42:13 +01:00
PolyMeilex
6915aeb44c Use nix mode for open_cloexec 2024-01-27 20:42:13 +01:00
PolyMeilex
23301e4895 Return Result from wopen_cloexec 2024-01-27 20:42:13 +01:00
Fabian Boehm
09cd7c7ad9 Remove widestring-suffix uses
This removes both the `#[widestrs]` annotation as well as all `"foo"L`
suffixes, and does a `cargo fmt` run on the result
2024-01-13 08:52:54 +01:00
Johannes Altmanninger
3ae20bdba0 Move fish-rust to project root 2024-01-13 03:58:33 +01:00