Terminal stuck? Do not close the window
Most stuck states have a one key exit. Closing the window hangs up every job running in it.
Published here · 6 sources · Resume reading
Terminal stuck? Do not close the window. Closing it hangs up every job running in it. Most stuck states have a one key exit.
The fix block
-
Output stopped (you hit Ctrl+S): press Ctrl+Q
-
SSH session frozen: press Enter, then ~ then .
-
Prompt turned into > (zsh: dquote>): the shell wants you to finish the command, often an open quote. Press Ctrl+C
-
Typing shows nothing or text is garbled: type
resetand Enter, even if you cannot see it (if Enter does nothing: Ctrl+J, reset, Ctrl+J) -
Ctrl+Z and the program vanished: it is stopped, not gone. Type
jobsto see it,fgto bring it back -
Stuck in a man page or git log: press q
Notes
Fixes 3, 4 and 5 are confirmed on Mac (bash 3.2, zsh 5.9). Ctrl+Q works while flow control (ixon) is on.
Send this to the friend who closes the whole terminal every time vim or less traps them.
Keep this guide
Filed under Dev tools
Questions about this guide
What does Ctrl+Q do?
It resumes output stopped by Ctrl+S (flow control).
How do I escape a frozen SSH session?
Press Enter, then ~ then . (tilde dot).
Sources
- Linux man: termiosman7.org
- OpenBSD man: sshman.openbsd.org
- Linux man: resetman7.org
- Linux man: bashman7.org
- Zsh docs: PS2 parameterzsh.sourceforge.io
- Linux man: lessman7.org