yank on double click and triple click#175
Open
NgoKimPhu wants to merge 2 commits intotmux-plugins:masterfrom
Open
yank on double click and triple click#175NgoKimPhu wants to merge 2 commits intotmux-plugins:masterfrom
NgoKimPhu wants to merge 2 commits intotmux-plugins:masterfrom
Conversation
345c399 to
76645fe
Compare
76645fe to
50c72e5
Compare
x3rAx
reviewed
Jun 3, 2025
yank.tmux
Outdated
|
|
||
| if [[ "$(yank_with_mouse)" == "on" ]]; then | ||
| tmux bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X "$(yank_action)" "$copy_command_mouse" | ||
| tmux bind-key -T copy-mode-vi DoubleClick1Pane "select-pane ; send-keys -X select-word ; run-shell -d 0.3 ; send-keys -X \"$(yank_action)\" \"$copy_command_mouse\"" |
There was a problem hiding this comment.
Hi, thanks for the PR, I was about to do the same :)
However, could you please change this to:
Suggested change
| tmux bind-key -T copy-mode-vi DoubleClick1Pane "select-pane ; send-keys -X select-word ; run-shell -d 0.3 ; send-keys -X \"$(yank_action)\" \"$copy_command_mouse\"" | |
| tmux bind-key -T copy-mode-vi SecondClick1Pane "select-pane ; send-keys -X select-word" | |
| tmux bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X "$(yank_action)" "$copy_command_mouse" |
Doing so should remove the need for the delayed run-shell. It also highlights the word immediately after the double click and does not wait if a triple click is triggered but copies only when no triple click occurs.
I haven't tested this here but I have something similar in my config:
# Double LMB select word in copy mode
#
# The `SecondClick1Pane` event is fired for the second click even if there
# is a `TripleClick1Pane` key binding.
bind-key -T copy-mode-vi SecondClick1Pane \
select-pane \; \
send-keys -X select-word
bind-key -T copy-mode-vi DoubleClick1Pane \
send-keys -X copy-pipe-no-clear "xclip -in -sel primary"
# Triple LMB Select Line in copy mode
bind-key -T copy-mode-vi TripleClick1Pane \
select-pane \; \
send-keys -X select-line \; \
send-keys -X copy-pipe-no-clear "xclip -in -sel primary"
Author
There was a problem hiding this comment.
updated! thanks for the suggestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
trigger yank action on mouse double click and triple click, both in copy-mode and in root mode