title: SSH, screen and XDISPLAY
body: <p>I use screen to persist my work session and connect to the same session from multiple machines. How can I setup SSH and screen such that the XDISPLAY variable <em>inside</em> my persistent screen session is always set to the machine I am currently connecting from?</p>
  
  <p>ie. I start the screen session at work and use gvim, which uses the X server running on my work machine. Later, I connect to the same session from home and also want to use gvim. But this time, I want gvim to use the X server on my home machine. I realize I could manually update XDISPLAY every time I connect from a different machine but I'd rather have an automated system.</p>
  
  <p>Bonus points if I can actually <em>move</em> gvim from my work machine to my home machine while it is running. I tried <a href="http://manpages.ubuntu.com/manpages/hardy/man1/xmove.html" rel="nofollow noreferrer">xmove</a> but could never get it to play nice.</p>