Re: simply preserving sessions across disconnect

Adam Kellas <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
On Thu, Jun 30, 2011 at 6:01 AM, Rich Boyce <rich-jcUp+/l53Jxaa/[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.