Tuesday 26 November 2013

Vim editor is frozen after CTRL+S

Many programs and clients use CTRL+S to save documents. In VI and VIM it's quite different. Even though I still press CTRL+S by accident every once in awhile.
To “unfreeze” the console simply hit CTRL+Q

Apparently CTRL+S actually does XOFF, which means the terminal will accept key strokes but won’t show the output of anything. Press CTRL+Q to turn flow-control on (XON)

To disable keyboard listening to XOFFs, add this to your .bashrc (man stty for more options)
stty ixany
stty ixoff -ixon
If you need to send CTRL+S and/or CTRL+Q you can just add
stty stop undef
stty start undef