From 6383376a605b930fde64b72e9851fe83dd535918 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 9 Nov 2024 01:12:22 +0300 Subject: various: Add tip about tmux and DISPLAY env var --- source/various-tips.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source/various-tips.rst') diff --git a/source/various-tips.rst b/source/various-tips.rst index a48161c..02baec8 100644 --- a/source/various-tips.rst +++ b/source/various-tips.rst @@ -13,6 +13,25 @@ To prevent the redirect, go to ``about:config`` and set the ``accessibility.blockautorefresh`` setting to ``true``. [#superuser.com-1]_ +Attach to tmux session without changing DISPLAY env var +--------------------------------------------------------- + +Sometimes I ssh into my PC from another one and attach to running tmux session, +do the work, disconnect and forget about it. Tut then after a while I notice +that I can't start graphical programs from the terminal, or to be precise, from +the shell sessions running in the tmux panes that have been created after I did +attach to tmux from under the SSH session. + +I found the solution in the man page of ``tmux(1)``:: + + If -E is used, the update-environment option will not be applied. + +So just use this command to attach and the ``DISPLAY`` environment variable will +be untouched in tmux session:: + + tmux a -E + + Footnotes --------- -- cgit v1.2.3