I usually use gnu screen like this: 1. start a screen session for all my tasks 2. When I login to a machine, I connect to a screen session (screen -x) made by my colleague (so this makes it an "inner screen")
Problem is, when I need to detach from the "inner screen" via ":detach" command or ctrl+a+d, I get detached from my main screen (in #1).
Is it possible to detach from "inner screen"?
Thanks
To detach it, type Ctrl-a Ctrl-d (most commands in screen start with Ctrl-a, this overrides the Ctrl-a command normally used when you want to jump to the start of a line).
s1 by doing: ctrl-a d. s2 by doing: ctrl-a a d. s3 by doing: ctrl-a a a d.
To start a screen session, you simply type screen within your ssh session. You then start your long-running process, type Ctrl+A Ctrl+D to detach from the session and screen -r to reattach when the time is right. Once you have multiple sessions running, reattaching to one then requires that you pick it from the list.
Use ctrl+a, a to send ctrl+a to the inner screen. That is, to detach the inner screen press ctrl+a, a, d. Alternatively press ctrl+a, a, and write :detach
.
I also work with the same screen setup as you and found it more convenient to change the ctrl+a shortcut to ctrl+l (lower case "L") on my local machine. That way you can access the inner screen directly with ctrl+a instead of the tedious ctrl+a, a. To do that add this to your local ~/.screenrc
:
escape ^La
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With