title: Python code crashes with "cannot connect to X server" when detaching ssh+tmux session
body: <p>I run Python code on a remote machine (which I ssh into) and then use Tmux. The code runs fine UNTIL I disconnect from the remote machine. The whole point of my connecting via Tmux is so that the code continues to run even when I'm not connected to the remote machine. When I reconnect later, I have the error message:</p>
  
  <pre><code>: cannot connect to X server localhost:11.0
  </code></pre>
  
  <p>Does anyone have an idea why this is happening or how I can stop it?</p>