szcf-weiya / techNotes

My notes about technology.
https://tech.hohoweiya.xyz/
11 stars 7 forks source link

no graphics of tmux session before ssh -X #46

Open szcf-weiya opened 1 year ago

szcf-weiya commented 1 year ago

Firstly, if I ssh -X to server, then open a tmux session, and plot in it, then the window can pop up.

However, for the tmux session that was established before ssh -X, even though I re-enter in the session opened by ssh -X, the plot window still cannot pop up.

The first attempt is to reset the display env variable, since I noticed that after ssh -X, either in bash or in tmux,

$ echo $DISPLAY 
localhost:11.0

or

> Sys.getenv("DISPLAY")
[1] "localhost:11.0"

while for the old tmux session,

> Sys.getenv("DISPLAY")
[1] ""

so I guess if I reset the env, the window should work, so I reset the env variable via

> Sys.setenv("DISPLAY" = "localhost:11.0")
> Sys.getenv("DISPLAY")                                                                                                                                                                
[1] "localhost:11.0"

however, no graphics window pops up.