tmux: Do not copy-and-cancel after a multi click

If I select a word or line with a double or triple click, I want it to
stay selected.
This commit is contained in:
2024-08-19 17:18:43 +02:00
parent 48d2ccec6c
commit 873021ba80

View File

@@ -16,6 +16,29 @@ set -g copy-command 'xclip -selection clipboard'
# Copy selection into primary selection (without aborting) # Copy selection into primary selection (without aborting)
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-no-clear "xclip -se p" bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-no-clear "xclip -se p"
# Select word or line on double or triple click respectively (w/o aborting).
# (These are the defaults w/o the `run -d 0.3; send -X copy-pipe-and-cancel`)
bind -T copy-mode-vi DoubleClick1Pane select-pane -t= \; send -X select-word
bind -T copy-mode-vi TripleClick1Pane select-pane -t= \; send -X select-line
bind -n DoubleClick1Pane {
select-pane -t=
if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" {
send -M
} {
copy-mode
send -X select-word
}
}
bind -n TripleClick1Pane {
select-pane -t=
if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" {
send -M
} {
copy-mode
send -X select-line
}
}
# https://github.com/neovim/neovim/wiki/FAQ#cursor-shape-doesnt-change-in-tmux # https://github.com/neovim/neovim/wiki/FAQ#cursor-shape-doesnt-change-in-tmux
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'