Reattaching `tmux` to your Xorg session 0 ▲ Jamie Tanna 1 hour ago · Tech · hide · 0 comments It happens infrequently enough to not investigate too much further, but sometimes I'll end up with my Xorg/X11 session crashing, or something else happening which leads to my existing tmux sessions failing to interact with the new X session, with errors like: % gh repo view --web Opening ... in your browser. Error: cannot open display: :0 % xsel xsel: Can't open display: (null) : Connection refused In this case, the existing panes/windows may end up seeing a related error about failing to connect to the display, but any new panes/windows created will be able to interact as expected. This is a bit of an annoying one, but one way we can solve this is to nudge these panes to use the new DISPLAY. In a new pane/window/terminal session, check the DISPLAY environment variable: % echo $DISPLAY :1 That's likely different to what it shows in one of those existing panes - if so, run: % export DISPLAY=:1 After which, you can then run commands that interact with your X session. It's possible to… No comments yet. Log in to reply on the Fediverse. Comments will appear here.