天天看点

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