How to make clipboard=unnamedplus work upon tmux reattach

105 views
Skip to first unread message

suan

unread,
Mar 21, 2012, 1:57:27 PM3/21/12
to vim...@googlegroups.com
I use a Mac locally and use tmux on a Debian box I often SSH into, and I also sync my clipboard using clipboard=unnamedplus which works fine. However, whenever I reattach a tmux session on the remote which has a vim session open, Trying to paste from elsewhere results in a "E353: Nothing in register +". I suspect it has something to do with the X-clipboard being different from when the vim session was started, since it only happens after I logout from the box and SSH back in again (reattaching without logging out doesn't cause the problem)

The only way I've found to fix this is to quit vim and open the file in it again.

Is there a way to prevent this from happening? Or a command I could run from within vim to fix it?

Ivan Krasilnikov

unread,
Mar 22, 2012, 2:08:05 PM3/22/12
to vim...@googlegroups.com
It's a general problem with X11. Once a connection with X11 server is
established, it doesn't let a client (i.e. vim) switch to using a
different server. You can solve it with an X11 proxy like xpra. It
opens a local, persistent X11 server for vim, to which you can attach
remotely at any time.

Start tmux on remote machine like this:
$ xpra start :100 && DISPLAY=:100 tmux

And attach to it like this:
$ xpra attach :100 & tmux attach
Or run "xpra attach ssh:$hostname:100" on your local machine in parallel to ssh.

Suan Aik Yeo

unread,
Mar 22, 2012, 4:32:02 PM3/22/12
to vim...@googlegroups.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Interesting! Trying it out now. Sooo pleasantly surprised that they have a package for Debian Lenny =)
Reply all
Reply to author
Forward
0 new messages