3

Many answers related to this topic suggest to map Ctrl+y to a command that pipes tmux show-buffer to xclip. In the specific case of cygwin, the correct way to interract with the Windows clipboard is to use /dev/clipboard.

I would like to configure tmux to automatically save a mouse selection into this file. Is it possible without key mapping?

1 Answer 1

0

tmux has an additional command :save-buffer filename

I haven't seen the examples you referenced piping tmux show-buffer to xclip. I have used a mapping change to do something similar with :save-buffer /dev/clipboard.

Integrate :save-buffer /dev/clipboard with your copy-selection mapping. My tmux.conf contains the following line:

    bind-key -T copy-mode-vi 'y' send-keys -X copy-selection \; save-buffer /dev/clipboard \; send-keys -X cancel # Yank selection in copy mode, copy to windows clipboard, cancel copy mode

I'll guess you want something similar to that but pertaining to your mouse selection (which I'm unfamiliar with). Like this?

    bind-key    -T copy-mode    MouseDragEnd1Pane send-keys -X copy-selection \; save-buffer /dev/clipboard \; send-keys -X cancel 

Reference you may enjoy: OpenBSD tmux man page. Their man pages are generally very complete. Buffer utilization: http://man.openbsd.org/OpenBSD-current/man1/tmux.1#BUFFERS Search the page also for "send-keys" for info.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .