diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 1e951a523..631a80b41 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -56,13 +56,9 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv alt-right nextd-or-forward-word bind --preset $argv alt-left prevd-or-backward-word - $legacy_bind --preset $argv \e\e\[C nextd-or-forward-word # iTerm2 default - $legacy_bind --preset $argv \e\e\[D prevd-or-backward-word # iTerm2 default bind --preset $argv alt-up history-token-search-backward bind --preset $argv alt-down history-token-search-forward - $legacy_bind --preset $argv \e\e\[A history-token-search-backward # iTerm2 default - $legacy_bind --preset $argv \e\e\[B history-token-search-forward # iTerm2 default # Bash compatibility # https://github.com/fish-shell/fish-shell/issues/89 bind --preset $argv alt-. history-token-search-backward diff --git a/src/input_common.rs b/src/input_common.rs index f3c7bacc7..6a0bfeb34 100644 --- a/src/input_common.rs +++ b/src/input_common.rs @@ -700,6 +700,17 @@ fn parse_escape_sequence( } return None; }; + if next == b'\x1b' { + return Some( + match self.parse_escape_sequence(buffer, have_escape_prefix) { + Some(mut nested_sequence) => { + nested_sequence.modifiers.alt = true; + nested_sequence + } + None => Key::from_raw(key::Invalid), + }, + ); + } if next == b'[' { // potential CSI return Some(self.parse_csi(buffer).unwrap_or(alt('[')));