Linux GNU 屏幕无响应,似乎被阻止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4367669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 23:57:28  来源:igfitidea点击:

The GNU screen is unresponsive, seems blocked

linuxfreezekillgnu-screen

提问by sirus

GNU Screen seems to freeze. Unable to enter user input.

GNU Screen 似乎冻结了。无法输入用户输入。

I was using GNU screen and when I pressed the screen it became unresponsive. I can execute all the GNU screen commands, but can't enter user input. I don't want to kill this screen as I have important work and I don't want to lose it.

我正在使用 GNU 屏幕,当我按下屏幕时,它变得没有响应。我可以执行所有 GNU 屏幕命令,但无法输入用户输入。我不想杀死这个屏幕,因为我有重要的工作,我不想失去它。

采纳答案by wkl

In the commands below, replace Ctrlwith whatever your escape key is for screen commands.

在下面的命令中,替换Ctrl为用于屏幕命令的任何转义键。

Try Ctrl+aq, which is the sequence to unblock scrolling.

尝试Ctrl+ aq,这是取消阻止滚动的顺序。

Ctrl+asis the sequence that blocks scrolling, which makes screen seem like it freezes.

Ctrl+as是阻止滚动的序列,这使屏幕看起来像冻结。

回答by Hazok

The above works great if that is your issue.

如果这是您的问题,上述方法效果很好。

This could also happen if you're ssh'd into another machine and haven't been to the window in awhile, then when you go back it's frozen. To fix this, you can try the following:

如果您通过 ssh 连接到另一台机器并且有一段时间没有去过窗口,则也可能发生这种情况,然后当您返回时它被冻结了。要解决此问题,您可以尝试以下操作:

1) Create a new window

1) 创建一个新窗口

Ctrl-a c

2) ssh into the box where you ssh'd into the box in the window that's frozen.

2) ssh 进入您通过 ssh 进入冻结窗口中的框的框。

3) Find the process the ssh is running under:

3)找到ssh运行的进程:

ps aux | grep <remote_box_on_frozen_screen>

or

或者

ps aux | grep <your_user_id>

4) Kill the process

4)杀死进程

kill <process_id>

回答by Daniel Reis

When using PuTTY, you can get an apparently freezed screen if you press Ctrl+s. This sends an Xoffsignalblocking the terminal's output.

使用腻子,你可以,如果你按下得到一个显然冻结屏幕Ctrl+ s。这会发送一个Xoff信号来阻止终端的输出。

The solution is to pressCtrl+qto send the Xonsignal.

解决方法是Ctrl+q发送Xon信号。

回答by Pylinux

When you do screen -lsthe first number of the screen name is the process id. So if the output is

当你做screen -ls屏幕名称的第一个数字是进程ID。所以如果输出是

There is a screen on:
    21605.pts-0.Random-server   (11/12/2017 11:44:15 PM)    (Detached)
1 Socket in /var/run/screen/S-kg.

Then this will kill it:

然后这将杀死它:

kill 21605

Notice the number for the kill command is the same as in the screen -lsoutput.

请注意,kill 命令的编号与screen -ls输出中的编号相同。

回答by Piskvor left the building

If you are using backtick commands in status line - that is, if your .screenrchas something like this:

如果您在状态行中使用反引号命令 - 也就是说,如果您.screenrc有这样的东西:

backtick 1 0 60 /some/script.sh

then you want to be sure that the script is fast: apparently backtick execution blocks all IO to screen.

那么您要确保脚本速度快:显然反引号执行会阻止所有 IO 到屏幕。

If you make changes to the config, you'll need to restart the screen session (as the config applies only to new sessions).

如果对配置进行更改,则需要重新启动屏幕会话(因为配置仅适用于新会话)。