Wednesday, September 7, 2011

Putty screen freeze due to CTRL-S


Over the last couple of day, I faced a problem of getting screen freezes while I was working on vi. It became very frustrating as I had to restart my putty and also remove the swap file.

I finally realised that the reason was I was pressing CTLR-S for saving a file out of sheer habit. CTLR-S on bash generally means XOFF (output off) and you need to do a CTLR-Q to turn it back on.

Instead of that a simple addition to .bash_profile can save you the trouble.
stty -ixon

However even with this I was getting a statment such as i-search when I would type CTLR-S.
For that I removed the binding from my bash shell. 
bind -r '\C-s'

So all in all the changes need in your .bash_profile is
bind -r '\C-s'
stty -ixon

5 comments:

  1. Thanks a lot. even I was stuck for an hour and running new session every time. PS I was using ctrl + A and pressing by mistake ctrl + s.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Replies
    1. Also, I am on way for how to "Save the screen sockets/sessions in case of reboots"

      Delete
  4. It's hilarious that such a strange, destructive and probably nowadays totally useless feature is even enabled by default.

    ReplyDelete