[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: screen and DISPLAY environment variable
From: |
Thomas Köhler |
Subject: |
Re: screen and DISPLAY environment variable |
Date: |
Sat, 10 Nov 2007 06:15:59 +0100 |
User-agent: |
Mutt/1.5.4i |
Hi,
Adam M wrote:
[...]
> Now, the problem is when I close PuTTY and then later relaunch it and
> reattach to the running screen session. When I open a new SSH connection
> to my Linux box, that shell often has a different DISPLAY variable than
> previously. Therefore, in order for X forwarding to work from within
> screen, every single shell window (that needs X) must have its DISPLAY
> variable updated appropriately.
I have setup my shell's .login to do something like this:
if [ -z "$DISPLAY" ] ; then
echo "Can't update X11 DISPLAY variable as \$DISPLAY is not set..."
else
echo "export DISPLAY=$DISPLAY" > ~/.x11
fi
and my precmd (executed each time a new prompt is being
displayed, bash uses something called prompt_command or similar
for this) looks similar to
if [ -f "$HOME/.x11" ] ; then
. ~/.x11
fi
(Well, in fact it's more complicated because it contains more
stuff, but that doesn't matter here ;-))
> Thanks,
> Adam
Ciao,
Thomas
--
Thomas Köhler Email: address@hidden
<>< WWW: http://gott-gehabt.de
IRC: tkoehler
PGP public key available from Homepage!
signature.asc
Description: Digital signature