Recovering from CTRL+S in Putty
Every once in awhile, I’ll press CTRL+S by accident while I’m inside a terminal window. For the longest time, this simple accidental keystroke meant I had reconnect to my Linux server, kill whatever program I was running, and then start it again. Eventually I got sick of this happening and decided to do what I should have done in the first place: Google It.
Apparently CTRL-S actually does XOFF, which means the terminal will accept key strokes but won’t show the output of anything. It will appear as if your terminal is dead when it’s really just waiting to be turned back on. The fix? Simply press CTRL-Q to turn flow-control on (XON). If you pressed a whole bunch of keys before pressing CTRL+Q, you’ll see the output from those keystrokes.
In the Windows world, CTRL+S is used as the Save command. Over the years, I’ve developed the habit of pressing CTRL+S every few minutes while working on a document, simply because I’ve had too much work lost from stupid errors. Thankfully, this habit will no longer get in my way of working in the Linux world.

24 Comments, Comment or Ping
xian
Yes!!!! Thanks so much! I imagined this was a simple issue, but my previous attempts at screaming and banging on the keyboard failed to elicit the magic Ctrl-Q combination…
Jul 27th, 2007
Raam
Haha, I’m glad this helped you! It drove me crazy for many months too. I just couldn’t believe it was so easy to crash a terminal session and I didn’t want to unlearn my habitual “Ctrl+S” habit for fear of losing work later on down the road.
Jul 27th, 2007
nissou
wicked, cheers! This has been bugging me for a while.
Feb 25th, 2008
Nitin
phew!!!
thanks so much…. i was fed up with this since morning…. can’t help pressing ctrl-s to save a file i’m editing
Feb 28th, 2008
Jerek Dain
Thanks! Been having problems with this.
Now knowing what it does, that could be quite useful. Would be great if I want to join a massive amount of lines in VI (uppercase J) over a slow connection. It’d still draw it all upon ctrl+q, but then I know I can tab away while it labors over the joins.
May 7th, 2008
Raam
That’s a great use of ctrl+q, Jerek! Thanks!
May 7th, 2008
Sri Kiran Jyothi
This was one hell of a bugging issue. Thanks a lot for getting rid of a really big pain in the neck.
May 26th, 2008
Tree
Its good to recover from ctrl-s BUT i need ctrl-s a lots in emacs, putty freezes everytime i press ctrl-s, how can i disable it?
Strange, sometimes i have this problem, sometimes i dont. I dont get it.
If you can help me, thanks
Jun 12th, 2008
Tree
Ok, i figured it now.
http://blog.i64.pl/PiosBlog/200610/29-linux-keyboard-shortcuts-you-should-know-about/
for somereason, my emacs lost his configuration when ran under screen. i created new screen window, started emacs and ctrl-s worked as search command as it should.
Thanks.
Jun 12th, 2008
Raam
Hey Tree, thanks for the update and the URL!
Jun 12th, 2008
Lucas
Thanks a lot for this!!!
Jun 27th, 2008
Morgy
Thanks For this, I found a way of disabling the CTRL-S sending XOFF.
add this to your .bashrc (man stty for more options)
stty ixany
stty ixoff -ixon
Some programs like rtorrent listen for CTRL-S. This might still be getting mapped to XOFF, we have only disabled listening to keybopard XOFFs NOT sending them. If you need to send CTRL-S and/or CTRL-Q you can add
stty stop undef
stty start undef
Jul 14th, 2008
Raam
Hey Morgy, thanks a lot for the tip! That is really useful.
Jul 14th, 2008
Blaze P.
thanks so much saved my life!!!
Jul 25th, 2008
Kyle
Thank you soooooo much! This has been really driving me crazy. Thanks!!!
Aug 12th, 2008
TF Wang
Thank you so much! Thank you , thank you!!
Sep 8th, 2008
Yuriy
Thank you! This has been driving me nuts all day while I’ve been working in VI! My CTRL-S habit kept “freezing” Putty and requiring me to reconnect to the server, argh!!
Sep 19th, 2008
K
Man, you’re my saviour !
Oct 18th, 2008
Said
Hey, thanks for a nice tip..
bless google + helpful people on the internet
Nov 8th, 2008
dyl
Just had to say thanks, I should have googled this a long time ago! d’oh! I use vi for text editing but I often hit ctrl-s out of habit from the many Windows programs using that shortcut to save.
This also sounds like a great way to hide some commands if someone is looking over your shoulder! hehe
Nov 18th, 2008
Raam
Haha yeah, it would definitely be a good way to hide commands from someone looking over your shoulder, but you’d need to have very good typing accuracy!
Nov 18th, 2008
Joaquin Cuenca Abela
Just to echo other people thanks!
I have bitten by this quite a few times, pressing Ctrl-S by accident when I wanted to press Ctrl-A in emacs.
Dec 17th, 2008
silk
WOOT!!! i completely agree with your “i should have googled it” … so nice!!
Dec 30th, 2008
Reply to “Recovering from CTRL+S in Putty”