views:

123

answers:

1

I have a few windows in a single screen session and then I want to detach my session. There is no problem with that.

But I can't find a way to restore all windows within my previously detached session. I can see that I can restore just one of them by ID.

But how can I reattach exact the same session environment with all the windows in it?

--

Updated:

If I type screen -d -r, this is what is says:

There are several suitable screens on:
    21074.pts-7.atx (05/29/2010 02:26:32 PM)    (Attached)
    3420.pts-3.atx  (05/29/2010 12:16:41 AM)    (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

How can I reattach all of them?

+4  A: 

screen -d -r : Reattach a session and if necessary detach it first.

This will reattach your old session, will all its windows. If your session is still attached, it will detach it before attaching it to the current terminal. This is quite useful when for example you have kept your screen session in an ssh terminal on another computer.

tonio
tonio, please check out question's update. Where is my mistake here?
Fedyashev Nikita
In your update, screen says it can't reattach a session, because it does not know which one to reattach: there are two. IT even gives you a hist on how to select one or another session (when you do not give a session id, it expects there is only one, and uses that one).Here the firs one is already attached, while the second is detached. Try reattaching it to the current terminal with`screen -r 3420.pts-3.atx`
tonio
I got it now. Thank you, tonio!
Fedyashev Nikita