How do I control a screen session inside a screen session?

gnu-screen, ssh, unix

Solution

`ctrl-a a` is the equivalent of sending `ctrl-a` to the child `screen`, so `ctrl-a a d` should disconnect from the first nested session. If you have them nested deeper, `ctrl-a a a d` will disconnect the second nested session, and keep adding additional `a`s as needed. If you're nesting deeper than 1 or 2 levels, though, don't ask for sympathy when your head explodes from trying to keep straight which session you're sending commands to...

Problem

``` my local machine's terminal screen session 12345 ssh me@remotemachine (I want to be here) screen session 67890 (I'm here) ``` I've got myself in the predicament where I cannot get to the ssh session to disconnect it. If I press ctrl-a ctrl-d in screen session 67890 it detaches me from session 12345. So how do I get to the 3rd level ssh session so I can disconnect it? Any kill based solution you offer must not harm the processes running in screen session 67890.

Original source