Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 8 down vote accepted

You just hit ctrl-a followed by an a to actually send the ctrl-a to the nested screen instance.

share|improve this answer
No, as RobM correctly notes, you must type ctrl-a a to send ctrl-a to the nested screen. – eldering Jul 11 '11 at 16:17
Yo dawg. I heard you like screens, so I put a ctrl-a in your ctrl-a so you can screen while you screen. – user67218 Feb 15 '12 at 17:46
Also works for remapped codes; my trigger is ctrl-g (because I like ctrl-a to go to the beginning of a line in bash), so in the nested session; ctrl-g g 2 selects window 2 in the nested screen, ctrl-g 1 selects window 1 in the initial screen. – jaygooby Mar 10 '14 at 12:10

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 a (plain).

So to create a new window in the nested session you would press ^a, a, c.

share|improve this answer

Yes, it is possible. You will need to redefine screen's escape character, e.g. set it to E when you call screen

screen -e^Eq
share|improve this answer
this is a better answer, and what i was looking for. i wanted to just know how to configure it properly, NOT how to workaround. Why press more keys that you have to, rebind it on teh nest so you know which screen your controlling for sure. – Brian Thomas Mar 22 at 21:11

'Ctrl-a a' sends a ctrl-a to the nested screen.

eg, if you want to add a new tab, you do 'ctrl-a a c'

if you want to disconnect: 'ctrl-a a d'

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .