I was making some changes to a remote file in vi using the terminal when I accidently pressed Ctrl+S instead of :wq
.
Now everything got hanged. I tried Escape,:q!
and all sorts of vi commans but nothing is responding. The Terminal Screen is stuck. I can't close the Terminal session as of now as it will lead to loss of all the changes. Please suggest what should be done
Ctrl+Q will undo Ctrl+S. These are ancient control codes to stop and resume output to a terminal. They can still be useful, for instance when you are
tailf
-ing a log file and something interesting scrolls by, but this era of unlimited scrollback buffers has really obsoleted them.I would like to complement zwets' accepted answer.
You can see the meaning of special keypresses by issuing the commands
stty -a
andman stty
.stty -a
prints all current settings of the terminal. The result in my terminal:man stty
prints the manual of stty. The part that is relevant here: