mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
Work around to prevent premature Ctrl-D from inserting spaces
Pressing Ctrl-D while a command is running results in a null key code in our input queue. That key code is bound to insert a space (without expanding abbreviations). Make it only insert a space if the commandline is non-empty, to accommodate this use case. This probably affects other keys as well. Closes #8871
This commit is contained in:
@@ -186,7 +186,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
|
||||
# Closing a command substitution expands abbreviations
|
||||
bind --preset $argv ")" self-insert expand-abbr
|
||||
# Ctrl-space inserts space without expanding abbrs
|
||||
bind --preset $argv -k nul 'commandline -i " "'
|
||||
bind --preset $argv -k nul 'test -n "$(commandline)" && commandline -i " "'
|
||||
# Shift-space (CSI u escape sequence) behaves like space because it's easy to mistype.
|
||||
bind --preset $argv \e\[32\;2u 'commandline -i " "; commandline -f expand-abbr'.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user