File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,13 @@ set_copy_mode_open_bindings() {
88
88
local key_bindings=$( get_tmux_option " $open_option " " $default_open_key " )
89
89
local key
90
90
for key in $key_bindings ; do
91
- tmux bind-key -t vi-copy " $key " copy-pipe " $open_command "
92
- tmux bind-key -t emacs-copy " $key " copy-pipe " $open_command "
91
+ if tmux-is-at-least 2.4; then
92
+ tmux bind-key -T copy-mode-vi " $key " send-keys -X copy-pipe-and-cancel " $open_command "
93
+ tmux bind-key -T copy-mode " $key " send-keys -X copy-pipe-and-cancel " $open_command "
94
+ else
95
+ tmux bind-key -t vi-copy " $key " copy-pipe " $open_command "
96
+ tmux bind-key -t emacs-copy " $key " copy-pipe " $open_command "
97
+ fi
93
98
done
94
99
}
95
100
@@ -98,8 +103,13 @@ set_copy_mode_open_editor_bindings() {
98
103
local key_bindings=$( get_tmux_option " $open_editor_option " " $default_open_editor_key " )
99
104
local key
100
105
for key in $key_bindings ; do
101
- tmux bind-key -t vi-copy " $key " copy-pipe " $editor_command "
102
- tmux bind-key -t emacs-copy " $key " copy-pipe " $editor_command "
106
+ if tmux-is-at-least 2.4; then
107
+ tmux bind-key -T copy-mode-vi " $key " send-keys -X copy-pipe-and-cancel " $editor_command "
108
+ tmux bind-key -T copy-mode " $key " send-keys -X copy-pipe-and-cancel " $editor_command "
109
+ else
110
+ tmux bind-key -t vi-copy " $key " copy-pipe " $editor_command "
111
+ tmux bind-key -t emacs-copy " $key " copy-pipe " $editor_command "
112
+ fi
103
113
done
104
114
}
105
115
You can’t perform that action at this time.
0 commit comments