天天看點

detach screen_關于linux:如何強制将Screen與另一個SSH會話分離?

Attach here and now. Whatever that means, just do it.

Note: It is always a good idea to check the status of your sessions by means of"screen -list".

BLOCKQUOTE>

您還可以輸入screen -x,它輸入速度更快,但不完全等效。 它将第二次連接配接會話而不先斷開連接配接,進而形成多顯示模式。

記住"螢幕醫生";screen -Dr

嘗試使用screen -d -r或screen -D -RR

如果那也不起作用怎麼辦?

簡短答案

重新連接配接而不彈出其他對象:screen -x

擷取顯示清單:^A *,選擇一個要斷開的顯示器,然後按d

解釋答案

背景:當我尋找具有相同問題描述的解決方案時,我總是着迷于此答案。我想提供更明智的解決方案。 (例如:另一個連接配接的螢幕具有不同的大小,并且我無法在終端中強制調整其大小。)

Note: PREFIX is usually ^A = ctrl+a

Note: the display may also be called:

"user front-end" (in at command manual in screen)

"client" (tmux vocabulary where this functionality is detach-client)

"terminal" (as we call the window in our user interface) /depending on

1.重新連接配接會話:screen -x

-x附加到未分離的螢幕會話而不分離它

2.列出此會話的顯示:PREFIX *

它是以下項的預設鍵綁定:PREFIX :displays。

在螢幕上執行該操作,确定我們要斷開連接配接的其他顯示器(例如,較小的尺寸)。 (當未選擇時,您目前的顯示以較亮的顔色/粗體顯示)。

term-type   size         user interface           window       Perms

---------- ------- ---------- ----------------- ----------     -----

screen     240x60         [email protected]/dev/pts/2      nb  0(zsh)        rwx

screen      78x40         [email protected]/dev/pts/0      nb  0(zsh)        rwx

使用箭頭↑ ↓選擇目标顯示,然後按d

如果沒有任何反應,則您嘗試分離自己的顯示器,而螢幕将不會分離它。如果是另一個,則在一兩秒之内,該條目将消失。

按ENTER退出清單。

可選:為了使内容适合您的螢幕,請重排:PREFIX F(大寫F)

螢幕手冊頁摘錄:

displays

Shows a tabular listing of all currently connected user front-ends (displays). This is most useful for multiuser sessions. The following keys can be used in displays list:

mouseclick Move to the selected line. Available when"mousetrack" is set to on.

space Refresh the list

d Detach that display

D Power detach that display

C-g, enter, or escape Exit the list