mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
Add back legacy bindings to address modifyOtherKeys regressions in iTerm2<3.5.12
As of303af07, iTerm2 3.5.11 on two different machines has two different behaviors. For unknown reasons, when pressing alt-right fish_key_reader shows "\e\[1\;9C" on one machine and "\e\[1\;3C" on another. Feels like iTerm2 interprets modifyOtherKeys differently, depending on configuration. We don't want to risk asking for the kitty keyboard protocol until iTerm2 3.5.12 (see https://github.com/fish-shell/fish-shell/issues/11004#issuecomment-2571494782). So let's work around around this weirdness by adding back the legacy bindings removed inc0bcd817ba(Remove obsolete bindings, 2024-04-28) and plan to remove them in a few years. Note that fish_key_reader still reports this as "left", which already has a different binding, but it looks like literal matches of legacy sequences have precedence. Fixes the problem described in https://github.com/fish-shell/fish-shell/issues/11192#issuecomment-2692247060 Closes #11192
This commit is contained in:
@@ -56,9 +56,13 @@ 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\[1\;9C nextd-or-forward-word # iTerm2 < 3.5.12
|
||||
$legacy_bind --preset $argv \e\[1\;9D prevd-or-backward-word # iTerm2 < 3.5.12
|
||||
|
||||
bind --preset $argv alt-up history-token-search-backward
|
||||
bind --preset $argv alt-down history-token-search-forward
|
||||
$legacy_bind --preset $argv \e\[1\;9A history-token-search-backward # iTerm2 < 3.5.12
|
||||
$legacy_bind --preset $argv \e\[1\;9B history-token-search-forward # iTerm2 < 3.5.12
|
||||
# Bash compatibility
|
||||
# https://github.com/fish-shell/fish-shell/issues/89
|
||||
bind --preset $argv alt-. history-token-search-backward
|
||||
|
||||
Reference in New Issue
Block a user