Sometimes to get access to screen console I need to user screen -rx
and not just screen -r
.
Any idea why and why this happens ?
Sometimes to get access to screen console I need to user screen -rx
and not just screen -r
.
Any idea why and why this happens ?
-x
attaches to an already running screen. Two or more terminals can share one session.
-r
restores a detached session
Most probably you have to use -x
when a session was not cleanly disconnected and is still considered running. The -xr
is unnecessary in that case.
screen -rx
attaches to a session that is already attached elsewhere, and allows simultaneous use of the screen session by all attached parties.
In the event that a screen -r
fails with something similar to:
There is a screen on:
10250.ttys016.ironforge (Attached)
There is no screen to be resumed.
... you can use screen -rd
to force the other party to detach & allow you to attach.
Use -x
if you want to attach to an already running screen without detaching the other sessions.
If the session hasn't disconnected cleanly, you have other options than -x
:
-d
does the same than typing C-A d from the controlling terminal for the session.-D
is the equivalent to the power detach key. (Both -d
&-D
are ignored, when not applicable.)-r
resume and -R
resume first appropriate.-D -R
for attach here and now. -d
.