Commit 5f6bfc0
committed
Fix #121
The issue was caused by incorrect parameter expansion.
Copycat saves the old bindings inside
/tmp/copycat_$(whoami)_recover_keys as they were provided on the command
line, e.g.
$ cat /tmp/copycat_$(whoami)_recover_keys | grep clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard"
When tmux-copycat restores the config it reads each line of that
temporary file into `key_cmd` and runs `tmux $key_cmd`. Now, when the
shell expands `$key_cmd` it expands `"xclip`, `-selection`, `clipboard"`
into separate words. `tmux $key_cmd` runs effectively as:
tmux bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "\"xclip" -selection "clipboard\""
Which is not what we want.
In order to fix this bug, this commit makes sure that a proper shell
expansion happens by using `sh -c`.1 parent 6f9b9cd commit 5f6bfc0
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments