More suscinct and flexible escape char fix

To handle the possibility of the escape character being anywhere in the
key passed to `key_binding_not_set`, I've opted to use parameter
replacement to escape every escape character. This is more suscinct, and
will make sure every '\' is handled.
This commit is contained in:
Evan Niessen-Derry 2016-10-01 19:28:28 -05:00
parent 6bd0e2b221
commit df09a123ef

View File

@ -45,8 +45,7 @@ server_option_value_not_changed() {
}
key_binding_not_set() {
local key="$1"
if [[ ${key} == '\' ]]; then key='\\'; fi
local key="${1//\\/\\\\}"
if $(tmux list-keys | grep -q "${KEY_BINDING_REGEX}${key}[[:space:]]"); then
return 1
else