106

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.

Vadim Kotov
8,2848 gold badges51 silver badges63 bronze badges
asked Dec 6, 2010 at 14:59
1

5 Answers 5

159

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.

answered Dec 6, 2010 at 15:03
Sign up to request clarification or add additional context in comments.

8 Comments

Well, it worked but only in one screen, in the other one it quit :(
You Sir, just made my day :) GNU screen documentation didn't come up when googling "gnu screen freeze" :/
I had the same problem. Only one screen was frozen, which made me believe the problem was "screen-specific". Indeed, I had accidentally pressed Ctrl-A s.
I'm so used to using CTRL+A to go to the front of the command line to add sudo (since I forgot to start with it) that when I'm using screen, I lock it all the time! As previous comment says, CTRL+A q mostly works, sometimes exists the screen. Wish CTRL+A was not the default, on servers I use alot I change it to the "ESC" key.
Combine this nasty little beast with PuTTY's awful Ctrl+S which sends a XOFF and it really makes me fear the "s" on my keyboard. It's evil. Oddly the PuTTY keystroke is Ctrl+Q to send a XON... "q" is the savior. Thank you, 6 year old answer.
|
72

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.

answered Feb 6, 2013 at 11:29

2 Comments

Also worked for me on ROXTerm on Linux -- screen was locked and gave me a login prompt.
That applies to plain Linux text console as well.
10

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

Ctrl-a c

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:

ps aux | grep <remote_box_on_frozen_screen>

or

ps aux | grep <your_user_id>

4) Kill the process

kill <process_id>
answered Apr 14, 2011 at 23:22

2 Comments

Don't know how I got things into such an unresponsive state, since usually ctrl-q works for me, but I had to do this and lose my work. +1 for the break-here-in-case-of-emergency advice
More often than not any frozen SSH connection can be forcefully closed by pressing Enter, then ~ and then . (see also here).
3

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

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 -ls output.

answered Nov 13, 2017 at 10:37

Comments

3

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

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.

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

answered Nov 28, 2018 at 9:35

1 Comment

I had a backtick script running just fine for a very long time. Did a kernel update from 4.20.4 -> 5.4.80 and all of a sudden I faced this issue. For whatever reason my script which calls sensors -u is much slower with the new kernel... quite the rabbit hole this sent me down.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.