Tmux 2.4 (April 2017) added a very useful copy-pipe-and-cancel
command.
The config below configures copying to the tmux buffer and the Windows system clipboard in one command, including click-and-drag copying (without holding shift). I'm sure there's a way to get this to work with copy-mode
(emacs style) but I'm not familiar enough with it to offer any advice. I've tested the config successfully both in WSL via PowerShell and WSL via MinTTY.
# Configure copying
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi Escape send-keys -X cancel
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "/mnt/c/Windows/System32/clip.exe"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "/mnt/c/Windows/System32/clip.exe"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "/mnt/c/Windows/System32/clip.exe"
Thanks a lot. This helped me a lot to configure if with
copy-mode
If someone already learned default key bindings of tmux (https://unix.stackexchange.com/a/58765/200236) and just want to have mouse support plus copying to windows clipboard then this is my
.tmux.conf