screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Restarting X and screen


From: Bruce Edge
Subject: Restarting X and screen
Date: Thu, 25 Jun 2009 09:18:06 -0700



Today's Topics:

  1. Restarting X and screen (David Collins)


----------------------------------------------------------------------

Message: 1
Date: Thu, 25 Jun 2009 16:57:13 +0100
From: David Collins <address@hidden>
Subject: Restarting X and screen
To: address@hidden
Message-ID:
       <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I use 5 different screen sessions for various different purposes on my
work computer (linux open suse). When the X server is restarted and I
re-attach the screen sessions I can no longer open programs that use
X. The error I get is "cannot open display :0.0" The xterm without the
screen session running can open an X app just fine.

Does anyone have any ways that I can stop this happening, usually it
isn't a problem but on the occsation it does happen I have to restart
the screen session.

Thanks
David


I use to script to save the x env:

#!/bin/bash
# Copy X env into a file that can be sourced from another shell.
host=$(hostname)
file=~/.ssh.env.$host
echo "set -a" >$file
env | grep -e SSH -e DISPLAY | grep -v TTY | sed -e 's/=\(.\+\)/="\1"/' >>$file
echo "set +a" >>$file

and an alias to reload it:
xenvload='. ~/.ssh.env.$hostname'

So form a new shell with the correct x env you run "xenvsave", then from the screen shells, run xenvload.

I'm sure there's an easier way but this works for me.

-Bruce



reply via email to

[Prev in Thread] Current Thread [Next in Thread]