Silence bind errors in default key bindings

This silences binding errors due to keys not found in the current
termcap config in the default fish bindings.

Closes #4188, #4431, and obviates the original fix for #1155

It was necessary to re-implement builtin_bind as a class in order to
avoid passing around the options array from function to function and
as adding an opts parameter to `get_terminfo_sequence` would require
otps to be passed to all other builtin_bind_ functions so they could, in
turn, pass it to `get_terminfo_sequence`.
This commit is contained in:
Mahmoud Al-Qudsi
2017-10-03 10:29:48 +02:00
parent cebb63c1b5
commit 46d1334f95
4 changed files with 95 additions and 46 deletions

View File

@@ -18,6 +18,11 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
end
end
# Silence warnings about unavailable keys. See #4431, 4188
if not contains -- -s $argv
set argv "-s" $argv
end
# These are shell-specific bindings that we share with vi mode.
__fish_shared_key_bindings $argv
or return # protect against invalid $argv