Re: screen inside of screen

Shane Hickey <[email protected]>
Newsgroups gmane.comp.gnu.screen
Organization Nerd Diarry
Message-ID <[email protected]>
Eureka!  I found my foolishness.  First I tried to set the escape
character on the remote box to ^\ and when I ssh'd to that box from
inside of a screen session, I still couldn't get it to accept the escape
character.

However, if I ssh'd into the remote box from a non-screen shell, I
didn't have any problem.  So, I looked at my .bashrc again to see what
might be happening.  For some reason (hysterical blindness?  madness?),
I didn't include this piece of my .bashrc last time I posted:

if [ "$TERM" = "screen" ]; then
        /usr/bin/fortune 
else 
        if [ "$TERM" != "dumb" ]; then
                exec screen
        fi
fi

I had just included this piece:

if [ "$TERM" = "screen" -a ! "$SHOWED_SCREEN_MESSAGE" = "true" ]; then
  detached_screens=`screen -list | grep Detached`
  if [ ! -z "$detached_screens" ]; then
    echo "+---------------------------------------+"
    echo "| Detached screens are available:       |"
    echo "$detached_screens"
    echo "+---------------------------------------+"
  else
    echo "[ screen is activated ]"
  fi
  export SHOWED_SCREEN_MESSAGE="true"
fi

Well, everytime I logged onto the remote host from inside of a screen'd
shell, I was seeing "[ screen is activated ]" on the remote host and
feeling warm fuzzies.  However, screen wasn't starting because my TERM
definition was following me over to the remote box.  So, while my TERM =
screen, screen wasn't running for that session.

I feel pretty lame.  

So, I modified my .bashrc to this:

if [ "$STARTED_SCREEN" = "true" ]; then
/usr/bin/fortune
else
        export STARTED_SCREEN="true"
        exec screen
fi

Thanks for all the help.  I apologize for my lack of clue on this one.

-- 
Shane Hickey <[email protected]> 
Nerd     http://www.nerddiary.org 
GPG KeyID: 777CBF3F Listening to:
This Night Has Opened My Eyes


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/gnu-screen/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
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.