There are screens in the list, but “no screen to be resumed”

gnu-screen

When I type screen -r I expect to either see: A list of screens to resume, or a message "There is no screen to be resumed."

Today, I see there is one screen, but I still get the message that there is no screen to be resumed:

[root@server chiliNUT]# screen -r
There is a screen on:
        27863.pts-1.server     (Attached)
There is no screen to be resumed.
[root@server chiliNUT]# screen -rx 27863
[detached]
[root@server chiliNUT]# screen -r
There is a screen on:
        27863.pts-1.server     (Attached)
There is no screen to be resumed.

Why is it reporting that the screen is attached? I just detached it on the line above ([detached])

Best Answer

As screen -r says, there is one screen, but it is attached. To resume it on your current terminal, you have to detach it from the other one first: screen -d -r 27863, see manpage -d.


Edit: use -d instead of -x.

Edit2: @alex78191: When using -x, screen attaches to the currently running session, resulting in a "multi-display mode": you see the session on both terminals simultaneously, i.e., when entering a command on one terminal, it also appears on the second. However, detaching from a multi-display mode just detaches the current terminal. You hence get the message that it is still attached (on the other terminal).

Related Question