ENV: I am running tmux in putty, on a windows 7 laptop. I do ssh to linux systems while working.
I have to solve two glitches with tmux, before using it for all my needs.
This is absolutely possible. All of the config lines below were copied from machines in different tmux panes back to my Windows machine. Yes, I putty into 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 (doesn't need to be on Windows, but you need one somewhere).
Essential ingredients:
Your network setup might differ a bit, especially on the X server display config but here it goes:
tmux
# allow 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 don't ever have to run tmux in a 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 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 env 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).