Copy with double click
exebixel opened this issue · 3 comments
exebixel commented
HI
I recently noticed that if I double click on a word in tmux the word is only copied to tmux primary and not to the clipboard
This is the minimum configuration I'm using
set -g @custom_copy_command 'wl-copy'
set -g @yank_selection_mouse 'clipboard'
set -g @yank_with_mouse on
Is there any option to allow double click to copy to clipboard ?
Shookit commented
I've been badly struggling with this, have you been able to figure out how to get double-click working?
kugel- commented
Same here. Drag and release works but double click not.
lauhub commented
I managed to achieve this under macOS, adding this to ~/.tmux.conf
bind -n DoubleClick1Pane \
select-pane \; \
copy-mode -M \; \
send -X select-word \; \
run-shell -d 0.1 \; \
send -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy" \; \
run-shell -d 0.01 \; \
send -X cancel
I think you should replace the "reattach-to-user-namespace pbcopy"
part with your own copy command. As I am not a tmux-yank guru, I am not sure if you can use directly custom_copy_command
, let us know what you wrote there.
Then sourcing the file:
tmux source ~/.tmux.conf