Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

4 Answers 4

up vote 6 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
3  
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
7  
Yo dawg. I heard you like screens, so I put a ctrl-a in your ctrl-a so you can screen while you screen. –  todofixthis 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 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

'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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.