tmux-yank icon indicating copy to clipboard operation
tmux-yank copied to clipboard

Copy with double click

Open exebixel opened this issue 2 years ago • 3 comments

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 ?

exebixel avatar Nov 22 '21 15:11 exebixel

I've been badly struggling with this, have you been able to figure out how to get double-click working?

Shookit avatar Dec 21 '21 13:12 Shookit

Same here. Drag and release works but double click not.

kugel- avatar Jan 03 '22 12:01 kugel-

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

lauhub avatar Nov 21 '22 22:11 lauhub