mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 08:42:44 +08:00
Work around Terminal.app's awkward alt-left/right sequences
Just do the more involved thing. Blergh. Fixes #2330.
This commit is contained in:
parent
3cc59a9a12
commit
7167ba6e08
|
@ -91,8 +91,16 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
|
|||
# One of these is alt+backspace.
|
||||
bind --preset $argv \e\x7f backward-kill-word
|
||||
bind --preset $argv \e\b backward-kill-word
|
||||
bind --preset $argv \eb backward-word
|
||||
bind --preset $argv \ef forward-word
|
||||
if not test "$TERM_PROGRAM" = Apple_Terminal
|
||||
bind --preset $argv \eb backward-word
|
||||
bind --preset $argv \ef forward-word
|
||||
else
|
||||
# Terminal.app sends \eb for alt+left, \ef for alt+right.
|
||||
# Yeah.
|
||||
bind --preset $argv \eb prevd-or-backward-word
|
||||
bind --preset $argv \ef nextd-or-forward-word
|
||||
end
|
||||
|
||||
bind --preset $argv \e\< beginning-of-buffer
|
||||
bind --preset $argv \e\> end-of-buffer
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user