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() {
19
19
type " $command " > /dev/null 2>&1
20
20
}
21
21
22
+ escape_for_regex () {
23
+ local inp=" $1 "
24
+ echo $inp | sed ' s/\\/\\\\/g'
25
+ }
26
+
22
27
# returns prefix key, e.g. 'C-a'
23
28
prefix () {
24
29
tmux show-option -gv prefix
@@ -45,7 +50,7 @@ server_option_value_not_changed() {
45
50
}
46
51
47
52
key_binding_not_set () {
48
- local key=" $1 "
53
+ local key=$( escape_for_regex " $1 " )
49
54
if $( tmux list-keys | grep -q " ${KEY_BINDING_REGEX}${key} [[:space:]]" ) ; then
50
55
return 1
51
56
else
@@ -54,8 +59,8 @@ key_binding_not_set() {
54
59
}
55
60
56
61
key_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 " )
59
64
if $( tmux list-keys | grep -q " ${KEY_BINDING_REGEX}${key} [[:space:]]\+${default_value} " ) ; then
60
65
# key still has the default binding
61
66
return 0
You can’t perform that action at this time.
0 commit comments