-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Version: fish, version 4.0b1-03a9f4
OS: Darwin 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:36:12 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6020 arm64
$TERM: xterm-256color
Regarding this change of behavior mention in release note:
ctrl-c during command input no longer prints ^C and a new prompt, but merely clears the command line. This restores the behavior from version 2.2. To revert to the old behavior, use bind ctrl-c __fish_cancel_commandline (#10213).
I was trying to revert back to the old behavior. However, setting bind -M insert ctrl-c __fish_cancel_commandline
does not work well with multi-line prompt (I am using starship).
On old fish 3.7.1:
/tmp/testgit on ᚠ master
❯ asdfa^C
/tmp/testgit on ᚠ master
❯
On 4.0b1-03a9f4:
/tmp/testgit on ᚠ master
/tmp/testgit on ᚠ master
❯
The ^C was actually printed, but immediately got overwritten by the new repaint. It should repaint on a newline instead of resetting back to beginning of current line.
On 3.7.1, both the preset cancel-commandline
and binding __fish_cancel_commandline
work fine and they both keep the old command line.
❯ bind \cc
bind --preset -m insert \cc cancel-commandline repaint-mode # either works fine
bind -m insert \cc __fish_cancel_commandline # either works fine
BTW, one suggestion for the Release Note: for the bind commands, maybe also mention that vim binding users also need -M insert
and -M visual
for the binding to work.