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() {
8888 local key_bindings=$( get_tmux_option " $open_option " " $default_open_key " )
8989 local key
9090 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
9398 done
9499}
95100
@@ -98,8 +103,13 @@ set_copy_mode_open_editor_bindings() {
98103 local key_bindings=$( get_tmux_option " $open_editor_option " " $default_open_editor_key " )
99104 local key
100105 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
103113 done
104114}
105115
You can’t perform that action at this time.
0 commit comments