Display env variable, tmux and zsh over ssh
I have been using zsh within tmux, and found upon reattaching tmux X forwarding wasn’t working. For example when trying to launch gvim I’d get the error:
E233: cannot open display
The problem, a quick google determined, is that each time I ssh into my sever a new $DISPLAY
environment variable is set. When I run ’tmux attach’ the new $DISPLAY variable is passed through (see http://stackoverflow.com/questions/8645053/how-do-i-start-tmux-with-my-current-environment) so any new windows within tmux will have the correct environment. However the environment of any existing windows can’t be changed, causing the problem.