This is absolutely possible. All of the configuration lines below were copied from machines in different tmux panes back to my Windows machine. Yes, I use PuTTY on one machine and tmux and ssh from there to others and can move my Vim yanks to any machine, including my Windows browser.
I do run an X server on Windows (it doesn't need to be on Windows, but you need one somewhere).
Essential ingredients:
- PuTTY 0.62 (on Windows)
- tmux 1.8 (on one Linux machine)
- xclip (on Linux machines)
- MobaXterm (on Windows for their X server)
Your network setup might differ a bit, especially on the X server display configuration, but here it goes:
tmux
# Allow the mouse to select panes setw -g mode-mouse on set-option -g mouse-select-pane on # Allow yank into system clipboard #bind C-y run "tmux save-buffer - | xclip -i" bind C-y run-shell -b "tmux show-buffer | xclip -selection clipboard -i" # Move x clipboard into tmux paste buffer bind C-p run-shell -b "xclip -o -selection clipboard | tmux load-buffer - ; tmux paste-buffer"
Vim
" Get some autoselect interaction with the system clipboard set guioptions=aA
MobaXterm
I keep this running, but I don't ever have to run tmux in an xterm shell. Make sure that the shared clipboard is selected in the X11 settings. I suppose Xming should work, but the settings for my other needs never seemed to work out. MobaXterm has other goodies I like anyway (file browsers, etc.).
I suppose I could run an SSH session with tmux in MobaXterm, but I prefer the PuTTY window where I have my solarized color palette.
PuTTY
SSH to the machine with tmux. At this point, I set the DISPLAY environment variable and put it in an environment file that is sourced by Bash. This way, every subsequent window created will have it set. Setting it on other machines that I hop to from the tmux machine is a separate exercise entirely.
In any machine that will be sharing the clipboard, make sure you have the proper $DISPLAY set. You should be able to run xeyes and see it on your local machine.
Everyone will be sharing the clipboard. Vim will copy to the clipboard when you yank. To paste in another tmux pane, use the bind-key Ctrl + P (Ctrl + A, Ctrl + P for me).
If it's not working, you can always try xclip -o -selection clipboard to see what should paste. You also will be able to move any "tmux selected" text (mouse or bind-key [) to the clipboard (and thus to a regular Windows window) with bind-key ctrl-y (i.e., tmux yank).