Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy with double click #156

Open
exebixel opened this issue Nov 22, 2021 · 3 comments
Open

Copy with double click #156

exebixel opened this issue Nov 22, 2021 · 3 comments

Comments

@exebixel
Copy link

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
Copy link

Shookit commented Dec 21, 2021

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

@kugel-
Copy link

kugel- commented Jan 3, 2022

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

@lauhub
Copy link

lauhub commented Nov 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants