File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ command_exists() {
1919 type " $command " > /dev/null 2>&1
2020}
2121
22+ escape_for_regex () {
23+ local inp=" $1 "
24+ echo $inp | sed ' s/\\/\\\\/g'
25+ }
26+
2227# returns prefix key, e.g. 'C-a'
2328prefix () {
2429 tmux show-option -gv prefix
@@ -45,7 +50,7 @@ server_option_value_not_changed() {
4550}
4651
4752key_binding_not_set () {
48- local key=" $1 "
53+ local key=$( escape_for_regex " $1 " )
4954 if $( tmux list-keys | grep -q " ${KEY_BINDING_REGEX}${key} [[:space:]]" ) ; then
5055 return 1
5156 else
@@ -54,8 +59,8 @@ key_binding_not_set() {
5459}
5560
5661key_binding_not_changed () {
57- local key=" $1 "
58- local default_value=" $2 "
62+ local key=$( escape_for_regex " $1 " )
63+ local default_value=$( escape_for_regex " $2 " )
5964 if $( tmux list-keys | grep -q " ${KEY_BINDING_REGEX}${key} [[:space:]]\+${default_value} " ) ; then
6065 # key still has the default binding
6166 return 0
You can’t perform that action at this time.
0 commit comments