On Thu, Jun 30, 2011 at 6:01 AM, Rich Boyce <r...@ebi.ac.uk> wrote: > That's precisely how I use screen. The way I do it is to have a snippet in > my bash login script which tests whether the scripts is running in screen > already, and if not runs 'screen -RR': > > if [ ! $WINDOW ] ; then # we're not already in screen > if [ -e `which screen` ]; then # we've got screen available > screen -RR # reattach to first available session > exit # logout when finished > fi > fi > > Note that I'm working in a networked environment where my home area is the > same on my local workstation and all the servers I connect to. > > That works just how you're describing what you want. It's transparent during > normal use, but if the connection to the remote server is lost then the > session is restored upon reconnect.
Rich, I'd be happy with a solution like this but can't see how it would work for me. How could $WINDOW ever be set at initial login? Maybe, in your case, you're using a command line ssh client which carries $WINDOW with it? In my case each new login is from a Windows box using Putty so nothing is the child of anything else from the initiating side. AK _______________________________________________ screen-users mailing list screen-users@gnu.org https://lists.gnu.org/mailman/listinfo/screen-users