Commit Graph

735 Commits

Author SHA1 Message Date
Johannes Altmanninger
6af96a81a8 Default bindings for token movement commands
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
There is no natural default binding for token movements. Add the
alt-{left,right,backspace,delete}, breaking some existing behavior.

For example, backward-delete-word is no longer bound to alt-backspace but
only to ctrl-backspace.  Unfortunately some terminals (particularly tmux)
don't support distinguishing ctrl-backspace from ctrl-h yet, so the loss
of alt-backspace may be tragic.

---

I guess we could also add:

    bind alt-B backward-token
    bind alt-F forward-token
    bind ctrl-W backward-kill-token
    bind alt-D kill-token

Those might be intercepted by the terminal on Linux, but I don't know where
that happens.

Tested on foot, kitty, alacritty, xterm, tmux, konsole and gnome-terminal.

Closes #10766
2024-10-13 14:53:45 +02:00
Fabian Boehm
e3ecfa729d CHANGELOG
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
The flow control thing isn't down to us, it's apparently a common
terminal issue where they no longer trigger suspend when CSI u is
used.
2024-10-08 19:34:24 +02:00
diniamo
052e764f29 accept-autosuggestion to return false if there was no autosuggestion to accept
Example usage:

    bind ctrl-space accept-autosuggestion and execute

Closes #10608
2024-10-05 23:43:16 +02:00
Jacob Chapman
a9cee9e755 Commands to move by entire tokens
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
ja: I'll try to add default bindings in a follow-up PR.

Closes #10738
Closes #2014
2024-10-05 22:43:39 +02:00
Johannes Altmanninger
243a8345ce Minor changelog updates
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
2024-09-28 18:00:02 +02:00
Johannes Altmanninger
2e9de57fd7 Document ctrl-backspace and bind ctrl-delete as well
This has a slightly different behavior than what the CUA user expects:
it fails to eat up trailing spaces.  We should probably fix this.
2024-09-23 14:52:50 +02:00
Johannes Altmanninger
904649c5c5 Bind ctrl-backspace to backward-kill-word
Closes #10741
2024-09-23 14:32:43 +02:00
Johannes Altmanninger
5432ee1aa9 Relax history autosuggestion and highlighting if cd is wrapped
For implementation reasons, we special-case cd in several ways
1. it gets different completions (handle_as_special_cd)
2. when highlighting, we honor CDPATH
3. we discard autosuggestions from history that don't have valid path arguments

There are some third-party tools like zoxide that redefine cd ("function cd
--wraps ...; ...; end"). We can't support this in general but let's try to
make an effort.

zoxide tries to be a superset of cd, so special case 1 is still
valid but 2 and 3 are not, because zoxide accepts some paths
that cd doesn't accept.

Let's add a hack to detect when "cd" actually means something else by checking
if there is any --wraps argument.

A cleaner solution is definitely possible but more effort.

Closes #10719
2024-09-14 08:51:42 +02:00
Johannes Altmanninger
77b2dcb462 Fix ctrl-c being ignored during builtin wait
Same as d21ed0fb2 (Disable terminal protocols before expanding wildcards,
2024-07-31).

Also mention a related issue in the changelog.
2024-09-01 14:08:01 +02:00
Fabian Boehm
c1d9f57107 CHANGELOG 2024-08-30 21:30:05 +02:00
Johannes Altmanninger
5918bca1eb Make "complete -e" prevent completion autoloading
We do the same for functions.

Closes #6716
2024-08-24 08:30:52 +02:00
Johannes Altmanninger
ebd23c9f86 Add back fish_key_reader --verbose
See #10663
2024-08-11 14:41:17 +02:00
Johannes Altmanninger
615b413335 Mention in changelog that universal notifiers are not yet supported on BSD 2024-08-05 10:41:17 +02:00
Amos Bird
041a26f647 Update TTY modes for external commands only after successful command
According to the discussion in #2315, we adopt TTY modes for external commands
mainly for "stty".  If our child process crashes (or SSH disconnect), we
might get weird modes. Let's ignore the modes in the failure case.

Co-authored-by: Johannes Altmanninger <aclopte@gmail.com>

Part of #10603
2024-08-03 17:51:48 +02:00
Peter Ammon
ff72080aac
Changelog fix for #10624 2024-07-21 19:20:46 -07:00
Nikita Bobko
e03e5e116d
fish_vi_key_bindings: add 'ab' and 'ib' vi text object
Part of #1842

The implementation is obviously isn't 100% vi compatible, but works good enough
for major cases

This commit depends on previous commits where jump-{to, till}-matching-bracket
motions were introduces
2024-06-30 11:58:10 -07:00
Nikita Bobko
f8ebe346a9
Implement jump-to-matching-bracket motion and bind % (percent) in vi mode
Part of #1842
2024-06-30 11:58:10 -07:00
Looouiiis
480d48351c feat(math): add round options (#9117)
Add round options, but I think can also add floor, ceiling, etc. And
the default mode is trunc.

Closes #9117

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2024-06-23 17:45:52 -05:00
David Adam
e95fc104ec CHANGELOG #830 2024-06-17 06:36:38 +08:00
Peter Ammon
aa83e155f5
Correct changelog for #10394 2024-06-15 12:16:55 -07:00
Peter Ammon
61a90deb8f
Changelog fix to #10394 2024-06-15 11:50:35 -07:00
Fabian Boehm
364c53c5e5 CHANGELOG 2024-06-06 16:50:13 +02:00
Fabian Boehm
28484e2498 CHANGELOG: Fix issue mention 2024-06-02 10:52:11 +02:00
Mahmoud Al-Qudsi
6ec09260dd Changelog: document #5263 and provide workaround
[ci skip]
2024-05-31 16:21:24 -05:00
Mahmoud Al-Qudsi
8c364dc949 CHANGELOG: Fix awkwardly formatted issue reference
The :issue:`xxxx` template generates text in the format (#xxxx), so this was
rendering as "... See (#xxxx)." which is just weird.

[ci skip]
2024-05-28 11:53:36 -05:00
Mahmoud Al-Qudsi
5b7fd61867 Fix single-backtick-quoted code expressions in CHANGELOG.rst
Reminder that reStructuredText is awkward and you can't make sphinx treat these
as inline code; they'll be formatted as italic text only.

Vim search expression:
    \([`:]\)\@<!`[^`:]\+`\(`\)\@!

Followed by
    ysi``

does the trick quite nicely.
2024-05-28 11:47:45 -05:00
Mahmoud Al-Qudsi
8b1c8ed791 CHANGELOG: Add #10506 and #10521 2024-05-28 11:09:09 -05:00
Fabian Boehm
89ed37d957 CHANGELOG 2024-05-25 13:21:02 +02:00
Johannes Altmanninger
6cd1323bfe Work on changelog 2024-05-24 15:16:17 +02:00
Johannes Altmanninger
8c073f56c2 Changelog issues from current milestone 2024-05-24 14:01:46 +02:00
Johannes Altmanninger
de7f39d627 builtin bind: make function keys lowercase (f1 instead of F1)
All other key names are lowercase so this inconsistency is weird.
2024-05-22 22:38:06 +02:00
Fabian Boehm
a72ba0408f CHANGELOG 2024-05-14 17:32:17 +02:00
Jonathan Krebs
07160e2f71 notice in CHANGELOG.rst 2024-05-11 11:12:29 -07:00
Anurag Singh
4fa8d95b98 Move push_timer to measure command substitution timing too 2024-05-03 09:32:26 +02:00
Johannes Altmanninger
91b007cab7 Limit ctrl-r autofill/replace to a single command substitution
As reported on gitter, commands like "rm (...)" sometimes want a previous
command inside the parentheses. Let's try that.  If a user actually wants
to search for a command substitution they can move the cursor outside the
command substitution, or type the search string after pressing ctrl-r?
2024-05-01 20:21:18 +02:00
Johannes Altmanninger
e7347b9581 Bind ctrl-Z to redo (since ctrl-z is undo)
In addition to the native Emacs undo binding, we also support ctrl-z.
On Linux, ctrl-shift-z alias ctrl-Z is the redo binding according to
https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts Let's bind allow
that.

Unfortunately ctrl-shift and ctrl-alt modified shortcuts on Linux may be
intercepted by the windowing system or the terminal. Only alt-shift seems to be
available reliably (but the shift bit should mean "extend selection" in Emacs).
2024-04-30 14:00:06 +02:00
Johannes Altmanninger
5756fa369f Changelog consistency improvement 2024-04-30 14:00:06 +02:00
Johannes Altmanninger
964d3fff15 Keep undo history across prompts
After abandoning a commandline (for example with ctrl-c) it's nice to be
able to restore it. There is little reason to discard the requisite undo
information, so keep it.
2024-04-29 09:20:09 +02:00
Johannes Altmanninger
301e4d497e Make shift-delete also delete current autosuggestion
This is a bit more convenient than using "history delete".
2024-04-27 10:54:31 +02:00
Anurag Singh
62a8b48fd1 Move generated completions to cache directory 2024-04-27 10:39:30 +02:00
Fabian Boehm
9954074dde CHANGELOG abbr --command 2024-04-24 18:20:25 +02:00
Johannes Altmanninger
24f0abe780 Fix decoding mulitbyte characters after escape prefix
Fixes #10457
2024-04-23 00:18:14 +02:00
Fabian Boehm
10a1458dea Some more CHANGELOG 2024-04-22 20:13:12 +02:00
Fabian Boehm
eb2ccc4ea9 Reword CHANGELOG a bit
Try to keep the "backwards-incompatible" section reasonably short so
people can get a quick overview of what they need to handle.

So we split the "bind" part into two.
2024-04-21 16:49:29 +02:00
Fabian Boehm
3584ffcb52 CHANGELOG 2024-04-21 14:35:13 +02:00
Johannes Altmanninger
b3444ea128 Work around ctrl-c in VSCode killing wl-copy and clearing clipboard
wl-copy is a daemon process that serves its stdin to any wl-paste processes.
On Wayland, we launch it from fish_clipboard_copy.  It then lives in the
same process group as fish (see `ps -o pid,pgid,comm`).

For some reason pressing ctrl-c inside the VSCode integrated terminal with
fish as the default shell kills the wl-copy process, thus clearing the
clipboard. On other terminals it works fine.

This is also reproducible by running "echo foo | wl-copy" ctrl-v ctrl-c ctrl-v
(the second ctrl-v does not paste because wl-copy was killed).

Work around this for now by running wl-copy asynchronously, and disowning it.
This seems to fix it though I really don't know why. Alternatively we could
"setsid" but that's technically not available on BSD.

For some reason this works in Bash. We should strace it to figure out why.
2024-04-21 14:34:41 +02:00
Johannes Altmanninger
c921c124ef docs: use canonical key names in :kbd: tags
This seems a bit better because it's what bind uses.  To makes sure that
something like :kbd:`ctrl-x` looks good in HTML, remove the border from the
kbd style.  Else both "ctrl" and "x" get small boxes which looks weird.
2024-04-20 15:36:29 +02:00
Johannes Altmanninger
e97a4fab71 Escape : and = in file completions
This is similar to f7dac82ed (Escape separators (colon and equals) to improve
completion, 2019-08-23) except we only escape : and = if they are the result of
file completions.  This way we avoid issues with custom completions like dd.
This also means that it won't work for things like __fish_complete_suffix
[*] but that can be fixed later, once we can serialize the DONT_ESCAPE flag.

By moving the escaping step earlier, this causes some unit test changes
which should not result in actual behavior change.

See also #6099

[*]: The new \: and \= does not leak from "complete -C" because that command
unescapes its output  -- unless --escape is given.
2024-04-20 13:34:08 +02:00
Johannes Altmanninger
24e4fdd695 Support "bind xyz" again
This was used in Vi mode (for yiw and "*p) so rejecting it is a bit reckless.
2024-04-20 13:34:08 +02:00
Johannes Altmanninger
e571774c97 Make alt-d on empty commandline call dirh again
alt-d used to do that until evil merge[*] 213e90704 (Merge remote-tracking branch
'upstream/master' into bind_mode, 2014-01-15) which changed the order of
the \ed bindings such that the smart dirh version would be shadowed by the
simpler ones.

[*] git blame alone failed to find it because it skips merge commits.
2024-04-20 12:11:30 +02:00