Commit Graph

18775 Commits

Author SHA1 Message Date
Johannes Altmanninger
1baa893e60 Don't end history search on focus in/out events
Apparently VTE terminals send the "focus in" event whenever we re-enable
focus reporting. That's probably a sensible thing to do.

Anyway, our problem is simply that we accidentally end history search on these
focus events which are implemented as anonymous (unmappable) readline cmds.
Perhaps there should be a separate cmd category.

Focus events show up as key::Invalid which is a weird private use code point;
probably we can get rid of this key..

Fixes #10411
2024-04-03 20:02:08 +02:00
Johannes Altmanninger
350598cb99 Decode arrow keys as sent by urxvt
Not sure if we want to support this indefinitely but appears to be free as
of today.
2024-04-03 19:37:03 +02:00
Fabian Boehm
e8eb4822ce input: Fix crash for weird bracketed paste
I can reproduce by pasting after

```fish
echo \cc foo | fish_clipboard_copy
```

in Wezterm
2024-04-03 16:30:38 +02:00
Johannes Altmanninger
cb58a30bf2 Report $PWD changes unconditionally
Similar to 20bbdb68f (Set terminal title unconditionally, 2024-03-30).

While at it, get rid of a few unnecessary guards (we are never called from
a command substitution, so the check only adds confusion).
2024-04-03 13:14:02 +02:00
Johannes Altmanninger
9870faa8be Remove workarounds for Emacs ansi-term
I'm not sure if it's worth supporting a terminal that mishandles unknown OSC
and CSI sequences. Better to fix the terminal.  Note that there are Emacs
terminals available that don't have this problems; for example "vterm".
2024-04-03 13:09:27 +02:00
Johannes Altmanninger
af1b599818 On redo, restore pre-undo cursor position 2024-04-03 13:09:27 +02:00
Fabian Boehm
3af849d739 tests/pexpect: Fix \d escape 2024-04-02 22:41:54 +02:00
Fabian Boehm
171869858a tests/histfile.py: Check for no jobs 2024-04-02 22:24:09 +02:00
Fabian Boehm
3d46987cff tests/histfile.py: Try exiting a second time 2024-04-02 22:19:47 +02:00
Fabian Boehm
fe95e4f4cd curses: Remove f13-f20
No longer supported by keys, and these are not a thing in the real world
2024-04-02 21:33:54 +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
Fabian Boehm
6501f7ab6f tests: Disable terminal.py under asan
We want asan to tell us about memory errors, not randomly fail tests
because it's too slow.
2024-04-02 19:57:57 +02:00
Johannes Altmanninger
695b408396 kitty keyboard protocol: decode numlock keys
Also disable the legacy matching hack for CSI u sequences, to prevent bindings
from treating this as prefix.
2024-04-02 18:20:35 +02:00
Johannes Altmanninger
b04dee358e Don't translate \n to enter
Apparently it's never entere because we turn off ICRNL.

I'm not sure why it says "no binding found".
2024-04-02 17:59:40 +02:00
Fabian Boehm
53961c7759 Fix doc formatting
This is RST, not markdown
2024-04-02 17:39:39 +02:00
Fabian Boehm
ec603790d1 nim prompt: Don't use test
A single-argument use, even!

Fixes #10404
2024-04-02 17:33:30 +02:00
Johannes Altmanninger
e8e91c97a6 fish_key_reader: ignore sentinel key
Also, move the undo grouping for paste to the right place.
2024-04-02 16:48:25 +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
Johannes Altmanninger
8ada027f05 Run asan and macOS CI in release mode too
I don't know why we're inconsistent about this, and at least asan fails
frequently due to timeouts.
2024-04-02 14:35:16 +02:00
Johannes Altmanninger
16c5ca2609 Fix mouse handling tests to send valid escape sequences 2024-04-02 14:35:16 +02:00
Johannes Altmanninger
22717339b4 fish_clipboard_paste: don't bypass pager search field.
To do so add an ad-hoc "commandline --search-field" to operate on pager
search field.

This is primarily motivated because a following commit reuses the
fish_clipboard_paste logic for bracketed paste. This avoids a regression.
2024-04-02 14:35:16 +02:00
Johannes Altmanninger
d0cdb142de Make CharEvent a native enum 2024-04-02 14:35:16 +02:00
Johannes Altmanninger
aa40c3fb7e Remove set-mode char event
Use generic shell commands instead.  This keeps us honest.

No functional change expected.
2024-04-02 14:35:16 +02:00
Johannes Altmanninger
20bbdb68fa Set terminal title unconditionally
Terminal titles are set with an OSC 0 sequence.  I don't think we want to
support terminals that react badly to unknown OSC (or CSI) sequences.

So let's remove our feature detection.

This will fix future false negatives along the lines of
https://github.com/fish-shell/fish-shell/pull/10037
2024-04-02 14:35:16 +02:00
Johannes Altmanninger
bb7704efe8 Fix potentially flaky tmux-history-search test
We need to give fish time to render I think.
2024-04-02 14:35:16 +02:00
Johannes Altmanninger
4149a37f1c Pull rust-terminfo-fix for rio terminal
https://github.com/meh/rust-terminfo/pull/42
2024-04-02 08:01:48 +02:00
Johannes Altmanninger
a216b3cf6a Print panic message to stderr, like the stack trace 2024-04-02 07:34:19 +02:00
Johannes Altmanninger
1232cfd3bb Fix typo 2024-04-02 07:33:07 +02:00
Johannes Altmanninger
af6dc9221f Use panic::set_hook instead of catch_unwind to help debug panics 2024-04-02 07:27:22 +02:00
David Adam
698d8bd315 add comment regarding lru hashing algorithm 2024-04-01 22:33:22 +08:00
Fabian Boehm
f4a3dcca3a docs: Clarify command substitution section
Put `$()` version front-and-center and make the quoting more
prominent.

In turn mention `()` as a version that can't be quoted.
2024-04-01 15:40:25 +02:00
David Adam
3a98db46bc
build.rs: pick up version file for tarballs from source, not build, directory (#10400) 2024-03-31 00:43:55 -05:00
Felix Luciano Salomon
1f68d66692
Added pbpaste command completions (#10389)
* Added pbpaste command completions
2024-03-30 22:35:53 -05:00
Mahmoud Al-Qudsi
41eaf2f8dc
Merge pull request #10398 from mqudsi/forward-char-passive
Add `forward-char-passive` and `backward-char-passive`
2024-03-30 22:29:46 -05:00
David Adam
792eff42b7 discard serial_test features
The default features are async and log, which are not utilised, and add
a significant number of dependencies to the tree.
2024-03-31 00:47:38 +08:00
Johannes Altmanninger
a29cc8f169 Fix regression when selection start is deleted
Ranges with start > end are invalid; we crash with "slice index starts at
10 but ends at 0".
2024-03-30 09:56:48 +01:00
Mahmoud Al-Qudsi
8eb7a08035 Document backward-char-passive 2024-03-29 14:23:53 -05:00
Mahmoud Al-Qudsi
1adbec2d37 Add backward-char-passive 2024-03-29 14:23:51 -05:00
Mahmoud Al-Qudsi
3980e46d3a Add test for forward-char-passive 2024-03-28 00:46:41 -05:00
Mahmoud Al-Qudsi
674c481d87 Add documentation for forward-char-passive 2024-03-28 00:18:24 -05:00
Mahmoud Al-Qudsi
df09ab598f Add forward-char-passive binding
This binding is akin to ForwardSingleChar but it is "passive" in that is not
intended to affect the meta state of the shell: autocompletions are not accepted
if the cursor is at the end of input and it does not have any effect in the
completions pager.
2024-03-28 00:13:34 -05:00
Fabian Boehm
b535213ac0 CHANGELOG abbr decorators 2024-03-27 22:13:27 +01:00
Fabian Boehm
217b009e18
abbr: expand command abbrs after decorators (#10396)
Currently, we expand command-abbrs (those with `--position command`) after `if`, but not after `command` or `builtin` or `time`:

```fish
abbr --add gc "git checkout"
```

will expand as `if gc` but not as `command gc`.

This was explicitly tested, but I have no idea why it shouldn't be?
2024-03-27 17:17:55 +01:00
Mahmoud Al-Qudsi
326d986186 Fix broken read_ni() not making fd non-blocking on Linux
The incorrect order of operations was being used since && binds tighter than ||
in rust (as with most sane languages).

Under Linux, EAGAIN == EWOULDBLOCK so this would always succeed in the case of a
non-blocking fd without making the call to make_fd_nonblocking().

Comparing to the 3.7.0 C++ code, it looks like this was an oversight introduced
in the migration to rust.
2024-03-26 01:06:42 -05:00
Johannes Altmanninger
62a49acda3 completions/iwctl: fix spurious error on "iwctl device foo" 2024-03-25 20:56:08 +01:00
Johannes Altmanninger
6efe0907e9 Fix --debug-output regression
We accidentally close FLOG output file.  Let's leak it for now; in future
we should close it.
2024-03-25 20:56:08 +01:00
Johannes Altmanninger
f5d6ea6cf6 Basic completions for gdbserver 2024-03-25 05:42:16 +01:00
Johannes Altmanninger
5b324f8ecb Fix regression in parse_util_process_extent
Found on a two-line commandline

    for file in (path base<TAB>
    echo
2024-03-24 16:34:36 +01:00
Johannes Altmanninger
1216801474 Use RAII for restoring term modes
In particular, this allows restoring the terminal on crashes, which is
feasible now that we have the panic handler.  Since std::process::exit() skips
destructors, we need to reshuffle some code.  The "exit_without_destructors"
semantics (which std::process::exit() als has) was mostly necessary for C++
since Rust leaks global variables by default.
2024-03-24 16:34:36 +01:00
Johannes Altmanninger
3cfa09d1bd Make test_init() return a scope guard
To be used in the next commit.
2024-03-24 16:33:35 +01:00