GNU 屏幕没有响应,似乎被阻止
GNU 屏幕似乎冻结了。无法输入用户输入。
我正在使用 GNU 屏幕,当我按下屏幕时,它变得没有响应。我可以执行所有 GNU 屏幕命令,但无法输入用户输入。我不想关闭这个屏幕,因为我有重要的工作,我不想失去它。
GNU Screen seems to freeze. Unable to enter user input.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在下面的命令中,将 Ctrl 替换为屏幕命令的转义键。
尝试 Ctrl+a q,这是解锁滚动的序列。
Ctrl+a s 是阻止滚动的序列,这使屏幕看起来像是冻结了。
In the commands below, replace Ctrl with whatever your escape key is for screen commands.
Try Ctrl+a q, which is the sequence to unblock scrolling.
Ctrl+a s is the sequence that blocks scrolling, which makes screen seem like it freezes.
使用 PuTTY 时,如果按 Ctrl+s,您可能会看到明显冻结的屏幕。
这会发送
Xoff signal
阻塞终端的输出。
解决方案是按Ctrl+q发送
Xon
信号。When using PuTTY, you can get an apparently freezed screen if you press Ctrl+s.
This sends an
Xoff
signal blocking the terminal's output.The solution is to press Ctrl+q to send the
Xon
signal.如果这是您的问题,上述方法非常有效。
如果您通过 ssh 连接到另一台计算机并且有一段时间没有访问该窗口,那么当您返回时它会被冻结,也可能会发生这种情况。要解决此问题,您可以尝试以下操作:
1) 创建一个新窗口
2) 通过 ssh 进入您之前通过 ssh 连接到冻结窗口中的框。
3) 找到 ssh 正在运行的进程:
或
4) 终止该进程
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:
1) Create a new window
2) ssh into the box where you ssh'd into the box in the window that's frozen.
3) Find the process the ssh is running under:
or
4) Kill the process
当您执行 screen -ls 时,屏幕名称的第一个数字是进程 ID。因此,如果输出为
Then this willkill it:
请注意,kill 命令的编号与 screen -ls 输出中的编号相同。
When you do
screen -ls
the first number of the screen name is the process id. So if the output isThen this will kill it:
Notice the number for the kill command is the same as in the
screen -ls
output.如果您在状态行中使用反引号命令 - 也就是说,如果您的
.screenrc
有类似这样的内容:那么您需要确保脚本速度很快:显然反引号执行会阻止所有屏幕 IO。
如果更改配置,则需要重新启动屏幕会话(因为配置仅适用于新会话)。
If you are using backtick commands in status line - that is, if your
.screenrc
has something like this:then you want to be sure that the script is fast: apparently backtick execution blocks all IO to screen.
If you make changes to the config, you'll need to restart the screen session (as the config applies only to new sessions).