I have a desktop at work that I use as a "tmux server." I ssh -Y u@Work_Desktop
from home into the Work Desktop then ssh -Y u@Work_Server
into another server at work. I run x applications like gv
and they work OK.
The connection looks like this: Home PC -> Work Desktop -> Work Server
My tmux on the Work Desktop contains many windows with ssh sessions into Work Server and other work resources.
At the end of the day, I detach from the tmux session using ctrl-B d
and log out of the Work Desktop.
The next day, I log into the Work Desktop and run tmux attach
. But now x no longer works and gv reports
Unable to open the display
and
wrong authentication
To fix this, I make a new tmux window and log into Work Server and echo $DISPLAY
. I take the DISPLAY from the new tmux window and go to my original tmux window and use export DISPLAY=DISPLAY_from_aforementioned_echo
. Now X works OK again, until I log back in the next morning and have to repeat this.
My question is, is there a way to avoid having to reset my DISPLAY setting like this every time I re-login into my Work Desktop?
I have tried the following in my .tmux.conf
(with and without DISPLAY), to no avail.
set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY DISPLAY"