Is it possible to run a gnu screen within a gnu screen? I'm not sure how the key bindings would work. I need to log into a server that is already running a screen session, from a local screen session.
If you clear the
$STY environment variable, running
screen will start a nested session.
You then have to send a literal
^a to the nested session before using any of your bindings. You can send a literla
^a by pressing
^a followed by
So to create a new window in the nested session you would press
The commands work fine if you use ctrl-a a or change the escape character. However, he also asked how to attach from inside another terminal. It took me a while to find this online, but after I saw the -m flag I looked it up in the manual.
-m cause screen to ignore the $STY environment variable. With "screen -m" creation of a new session is enforced, regardless whether screen is called from within another screen session or not. This flag has a special meaning in connection with the `-d' option: -d -m Start screen in "detached" mode. This creates a new session but doesn't attach to it. This is useful for system startup scripts. -D -m This also starts screen in "detached" mode, but doesn't fork a new process. The command exits if the session terminates.
After that I tested creating a new screen with
and the attaching to it from within screen with
screen -R -D
and it worked the way I wanted, creating a new screen and attaching to it from withing screen. I don't think many people will use this functionality, but sometimes I run out of terminals so it may be useful to have grouped tabs in a seperate screen.