Smokes your problems, coughs fresh air.

GNU Screen within Screen within […]

GNU Screen is great. So great that I find myself always using it. (Pressing the Window key and T launches an XTerm with a new Screen ready on my system, while I have to add Shift if I don’t want the screen.) This means that when I login into a some other machine through SSH—an occasion for which Screen is particularly useful—I will often end up with nested screens. So which Screen will receive my Ctrl+a presses?

The answer (courtesy of Google and Yacin Nadji) is that Ctrl+a will target the outer screen. Each a that you add after that will go down one nesting level.

Not that I don’t still find controlling nested screen confusing, but now at least I don’t feel helpless and stuck whenever it happens. 😉

Extra tips

  1. Visible captions make it easier:

    GNU Screen within Screen with captions

    GNU Screen within Screen with captions

    (If you don’t know how to configure Screen with captions, I’ve blogged about his previously.)

  2. Debian Administration, a very high-quality site has an article about GNU Screen.

5 Comments

  1. Andras Horvath

    Thanks for sharing, just what i needed 😉

  2. Alex Swanson

    Great info. THanks for the post.

  3. Rogerio Hilbert Lima

    Thanks a lot 😀

  4. Jay Straw

    Hey man, this wouldn’t work for me, nor did having different escape sequences in the respected screens — the kicker I found in a superuser.com answer by RobM http://superuser.com/questions/232483/how-do-you-run-a-gnu-screen-within-a-gnu-screen

    $ screen
    $ screen # frustration
    $ exit
    [screen is terminating]
    $ unset STY
    $ screen # power and glory

    The $STY environment variable is set to the “pid.tty” of the first screen, which is carried over into the nested screen. Which means to me, the nested screen is indeed getting my commands — but it’s sending them to the first screen. Because when I clear it, and allow it to be set properly, it works.

    This is better than a hot fudge sundae.

  5. Scott

    Thanks for the tip ! I just launched a screen session within a screen session, and now having the power to control the inner screen session is super helpful !

© 2024 BigSmoke

Theme by Anders NorenUp ↑