Skip to content

Commit 57ce423

Browse files
authored
Merge pull request #117 from inkarkat/bug-keybinding-globbing
BUG: keybinding values undergo globbing, may break mappings
2 parents dd24d36 + 23cd5b3 commit 57ce423

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

copycat.tmux

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,19 @@ set_start_bindings() {
4545
}
4646

4747
set_copycat_search_binding() {
48-
local key_bindings=$(get_tmux_option "$copycat_search_option" "$default_copycat_search_key")
48+
local key_bindings
49+
read -r -d '' -a key_bindings <<<"$(get_tmux_option "$copycat_search_option" "$default_copycat_search_key")"
4950
local key
50-
for key in $key_bindings; do
51+
for key in "${key_bindings[@]}"; do
5152
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/copycat_search.sh"
5253
done
5354
}
5455

5556
set_copycat_git_special_binding() {
56-
local key_bindings=$(get_tmux_option "$copycat_git_search_option" "$default_git_search_key")
57+
local key_bindings
58+
read -r -d '' -a key_bindings <<<"$(get_tmux_option "$copycat_git_search_option" "$default_git_search_key")"
5759
local key
58-
for key in $key_bindings; do
60+
for key in "${key_bindings[@]}"; do
5961
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/copycat_git_special.sh #{pane_current_path}"
6062
done
6163
}

0 commit comments

Comments
 (0)