Hi Adam,

On 29/06/11 20:26, Adam Kellas wrote:
I think I failed to make the desired usage model clear. I gather most
people are in the mode of (a) log in, then (b) run "screen", and (c)
use screen thereafter to multiplex sessions. But my goal is to make
use of screen completely invisible[*]. In PuTTY one of the
configurables is the ssh "Remote Command" which by default is $SHELL.
I'm trying to configure putty with a remote command of "screen
<some-flags>" such that putty will automatically start up a screen
instance and that instance will either attach to an existing detached
session or create a new one. So one putty window == one screen window.
The idea is that this would be just like not using screen but sessions
aren't dropped when the network is.

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.

Hope this helps!
Rich

--
Rich Boyce
Systems Administrator, Desktop Team
EBI Systems Group

_______________________________________________
screen-users mailing list
screen-users@gnu.org
https://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to