views:

1297

answers:

2

I've accidentally attached to a 2nd GNU screen session from within an existing screen session and cannot detach or issue commands to the inner screen. I remember figuring out how to do that before but completely forgot and would like to keep it as reference.

One way is to detach the inner screen by doing screen -dr from shell, but what is the key combination to do that from within screen itself?

+13  A: 

ctrl-a a d

chaos
If you've customized screen's escape character to something other than Ctrl-A, then the key sequence will be quite different. :)
slacy
Yeah, you're on your own with that. <esc> a d may work; the man page is ambiguous, since it says that a sends the escape character, then clarifies that what it means by that is ctrl-A. So it's a crapshoot.
chaos
Thanks, there we go, that's exactly what I remembered too and when I told it to my co-worker who was having this problem, he said it didn't work. Of course, now I found out he was pressing ctrl-a, ctrl-a, d, instead of ctrl-a, a, d.Voted and closed.
Artem Russakovskii
I <3 stackoverflow. I just had this issue, and it's the 2nd google result. Thanks a heap!
David Claridge
+2  A: 

ctrl+a a will pass the escape sequence (ctrl+a) to the sub-screen.. So, ctrl+a a d will do ctrl+a d in the sub-screen (detaching it)

It works with any screen command, for example ctrl+a, a, c will create a window in the sub-screen

dbr