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.


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…
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.
wicked, cheers! This has been bugging me for a while.
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
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.
That’s a great use of ctrl+q, Jerek! Thanks!
This was one hell of a bugging issue. Thanks a lot for getting rid of a really big pain in the neck.
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
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.
Hey Tree, thanks for the update and the URL!
Thanks a lot for this!!!
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
Hey Morgy, thanks a lot for the tip! That is really useful.
thanks so much saved my life!!!
Thank you soooooo much! This has been really driving me crazy. Thanks!!!
Thank you so much! Thank you , thank you!!
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!!
Man, you’re my saviour !
Hey, thanks for a nice tip..
bless google + helpful people on the internet
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
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! :D
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.
WOOT!!! i completely agree with your “i should have googled it” … so nice!!
You have NO idea how helpful you’ve been today. Likewise, I have the habit of pressing to save and it usually becomes an issue when editing a document in vim. No longer!
Always happy to hear I could help! :)
Too easy….
Na endlich eine Lösung zu diesem blöden ShortCut, da hat das ewige öffnen von neuen Sessions endliche ein Ende
Danke, danke, danke
Bitte, Bert! Glad to help!
Thanks a lot from me also! (#29 in this list, eh?)
You’re welcome, Matthias! :D
Thanks! That saved me quite a headache as well.
Good work, this has been an annoyance for some time :)
This has happened to me a couple of times while editing files in vi – I thought I’d gone into a weird vi mode that I couldn’t get out of (yet couldn’t find documentation on it anywhere!). Then today it happened on the command line so guessed it was putty. Thanks for the post! Will save me time and time again in the future!
thaaaaaaaaank you :)
You’re welcome, Ivan! :)
Im currently using the Windows version of Putty and for the life of me can’t figure out how to disable Ctrl-S from suspending my Putty window, its getting quite annoying.
I think the Windows version differs from the version the above users are using since I don’t have a .rcbash to work with.
I have tried going to Connection > Serial and selecting None in Flow Control but no luck.
Please help
Hi Johnson,
I’m not sure if you can entirely disable CTRL+S in Windows, but simply pressing CTRL+Q after accidentally pressing CTRL+S should return the terminal to a normal state.
thanks
You’re welcome, Hai.
You are awesome! I press CTRL+S wayyyy to much out of habit.
CTRL+S is a good habit to have! I’d rather accidentally suspend my terminal than lose a ton of work in some other Windows program! :)
Oh boy! I had been totally over this since yesterday and bugged a couple of people at work also. I am so glad to have found this blog. Thanks Raam for pointing this out. Whew…. I am relieved now :)
You’re welcome, Galred! I’m glad you found this post! :)
Thank you so so much!
You’re welcome, Sevak!
Awesome post
Thanks Tom!
It’s hilarious how such a simple thing can wreak so much havoc. This was driving me nuts for a while. And judging by the amount of comments, some other people too… Thanks for the tip.
Glad I could help. :)
Hi Raam,
Many Thanks Dude…
I have faced this pain many times man… Instead of pressing ctrl+c i will press ctrl+s…. denn fucked,….. close that session open a new one…
from now i wont have such probs… :) thanks again….
You’re welcome, Kiran! Thanks for stopping by! :)
Thank you thank you thank you.
You’re welcome welcome welcome, Ken!
Thanks so much!
In Emacs, CTRL+X then CTRL+S saves your document. Unfortunately, I’ll oftentimes press CTRL+Z (fatfingered CTRL+X) then CTRL+S. The CTRL+Z will background Emacs (returning to the shell) and then the CTRL+S performs the XOFF, which sucks because it meant recovering the file that I was attempting to save.
Thanks so much for this solution!
I feel your pain, Josh, and you’re welcome!
haha this made my day and put big smile on my face!!!!! i was about to close the terminal n reconnect but yeah Googled it and saved me from alot of anger!
I’m happy to hear this made you smile! :D
You just saved me from a session of head-banging. Thanks!
Head-banging == bad! Glad I could help!
Very good responses from many users. Great post.
I have a quick question.
Does CTRL+s pauses the processing until we press CTRL+q?
Howdy. No, it does not pause processing … it just locks the scroll buffer. For a simple illustration of this, start up screen, then run the following:
while sleep 1 ; do date ; done
While this is running, hit CTRL-s, wait ten or so seconds, and hit CTRL-q.
Many thanks!
A chilled beer is there for your disposal should you travel to Munich or Bangalore!
You’re welcome, Chandra! I’m planning on traveling soon, so I might take you up on that offer! :D
Thank You !!! Finally no more reloading sessions. :)
You’re welcome, PolarBear! :)
Hey Buddy,
Thanks a lot for this useful information…
You’re welcome, Shyam!
you are a life saver. ctrl+s was a constant pain for me. thanks for putting up this page.
-admirer
You’re welcome! Thanks for stopping by! :)
You life saver you! Thanks :D.
A thankful man!
You’re welcome, Mr. Thankful! :)
Thanks
You’re welcome, Martin!
Thanks. Was getting extremely tired of exiting putty and recovering swap files. :)
You’re welcome, Bruce! I remember the time consuming frustration of recovering those swaps files! :)
You da man… Was driving me crazy!!!
Haha, thanks Tim! Glad I could help. :)
thank you for the information, i realized it was ctrl+s that freezed the screen not connection problems after the third time
You’re welcome! Glad I could help. :)
Merci beaucoup!
Tu m’as sauvé la vie…
Son….Son…..SON….
I’m saying…..
Thank you.
You’re most welcome, Kokopelli! :)
thanks……
You’re welcome, Pitt! :)
:D … can’t say more.
Thanks, i was having the same problem :) thanks a lot.
\m/
You’re welcome, Pedro! :)
Omg thanks for this! I got soooo sick of this crap. I landed here by searching this on Google believe it or not:
“what the fuck does control s do in vim”
Haha, that’s hilarious! I’m happy it helped!
Awesome! I’ve been breaking my head on this one… Saves me a lot of time reconnecting and rewriting some code I’ve written between the previous save and when pressing CTRL + s!
Glad to hear I could help, Niels! :)
Thanks!!! I needed that. :-)
You’re welcome, Jesse! Glad to help!
“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.” – word!
:)
This had me pulling my hair out. Thanks!
I know the feeling! Glad I could help. :)
Thanks!
This have been bugging me a looong time
Glad I could help! :)
Thanks a lot!
Thank you soooooooooooo much.. I would have been in trouble.. thank you thank you thank you…
You’re welcome! :D
Thank you! This happens to me every now and then and never fails to p!$$ me off.
You’re welcome! :)
Thank you so much.. this has been bugging me for a while now.. cheers :)
cheers
haha, this was great thanks.
Glad to help! :)
thnx a lot :) that worked well..
useful for de one who s used to Windows Doc
I love you.
Thanks to google I found you
And thanks to you that you found the solution
Glad I could help, HerrSerker! :)
Man, thanks so much! I was going insane for a while with that one.
I’m a Windows programmer who occasionally uses Linux, and I honestly can’t stop myself from hitting ctrl+s every few minutes.
Glad I could help man. :) I grew up on Windows and developed the CTRL+S habit early on!
“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.
…
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.”
DEJA-VU. This is exactly why I’m here.
Thanks for posting this (and being on top of the google hits!)
Haha, thank Google for getting me to the top… it seems I’m certainly not the only one. :)
Thanks for this.
After some messing around I noticed CTRL+C works as well, at least for me. The only difference is that it does not execute any of the commands entered since CTRL+S was pressed. It seems to be just a simple interrupt.
Cheers.
Thanks for the note, Robbie. CTRL+C never worked for me, so perhaps its a difference in terminal settings or keybindings.
Thanks!
Glad to help, Nathan! :)
Funny that after decades of using Mac/Windows/*nix, I only just started making this mistake. Ctrl-Q is so much easier than killing the PuTTY session, logging in again, and recovering the file! Add my thanks to the many over the past four years.
You’re welcome, Dave! It took me almost a year of pressing CTRL+S and then killing Putty before I hunkered down and looked for the solution. :)
This helped me too! The gift that keeps on giving.
It’s definitely the gift that keeps on giving! I had no idea how many people this would help when I published it. :)
Damn love you man!… i was sick and tired of that shit…
Haha, I hear you man. Glad I could help. :)
Thank you very much. Pressing Ctrl+S to “save” while in a terminal session has been quite a huge problem for me down the road. This post made my day. =)
You’re welcome, Espen! Glad to help! :)
Thank you! I’ve also been trapped – until now :).
Glad to help, Visko! Cheers! :)
Bravo. I finally got rid of this trouble by your Ctrl+Q way. Thanks much.
Glad I could help, Zhipeng! :)
Yet another soul saved from lost work by your post.
This is why blogs are awesome. Post about some obscure thing you figure out, you never know how many people you’re going to help.
Thanks!
Glad I could help, Jeremy! That’s why I love blogs too! :)
Man, you saved me! Thanks from Rio, Brazil!
Awesome! Glad I could help, Leo! :)
Yay!
I’ve been doing this for 12 years or so.. THANK YOU :D
Haha, glad I could help, John! :)
Your are great.
I work a lot with putty and had that problem since…. years!. I thought it was a bug in putty or on my ssh server.
This really helps my <>. Thank you so much.
Thanks, Py! I thought it was a bug in Putty or SSH too, but then I realized both of those have been used by so many people that I must be missing something!
Yes ! Thanks !
You’re welcome, Marcus! :)
This post will never be old, because there are many people still trapped on Ctrl+S habbit like me , haha.
Thanks Raam.
Haha, I hear ya! It took me months to replace my CTRL+S habit with Cmd+S when I switched to Mac OS X. :)
Single most useful post I’ve read all year! Thanks!
Glad I could help, Tom! :)
4 years on from your post and it’s still a godsend.
And while I’m here, just seen your intriguing About description. I think I’ll read more. I’m liking the social responsibility bit. We’re just about to launch a boardgame for iPad with 5% going to Amazon Conservation Association. Seems like a little way to give something back in the right direction.
Paul, that’s fantastic! Thank you for setting an example for others to follow. Imagine how much good we could do if all apps in the App Store gave 5% of each transaction to a charity. And I mean really, when you look at it on a per-transaction basis, would we miss that tiny amount?
You just became my personal hero.
Thanks!
ztank
Glad I could help, Claudio! :)
Same here! Thankyouthankyouthankyouthankyouthankyou!
Haha, you’re most welcome, Gabe! :)
I share everyone’s gratitude towards you. You saved me a lot of trouble.
Glad to help! :D
Thank you so much! I’m always alt-tabbing back and forth between Komodo Edit (uses CTRL-S to save) and a putty terminal and I’ve run into this a million times.
So sick of having to restart putty session and recover whatever file I was editing.
This is an awesome tip.
You’re welcome, Mike! Glad this helped. :)
Thanks a boatload! You just saved my notebook from serious physical damage.
You’re welcome, Doodio! Who knew that this post would become so helpful when I posted it a few years ago. :D
Wow, thanks! After having my putty console freeze for the 3rd time today, I decided to google “putty ctrl+s” and lo and behold, your page came up and solved all my life’s problems!
Seriously though, thanks for posting :)
You’re most welcome, Craig! Glad I could help. :)
This thing is really anoying… Thanks a lot, it was driving me crazy
Glad I could help, Remiz! :D
Awesome. I though it was vim getting back at people who use gui editors! Forgot all about putty in the middle. Thx much.
Haha, glad I could help, Chad! :)
Thanks, this helped so much!!
Glad I could help, Graham! :)
A life saver! Greetings from Chile!
Glad it helped, JLO! :) I’d love to visit Chile sometime! :D
This was such a helpful post!
Glad you found it helpful, Tom! :)
Oh man thanks, this was driving me nuts.
Glad it helped, Steven! :)
Thanks a lot!
The Ctrl+Q really kills the devil :)
You’re welcome, Alhad! :)
wow – this is an active thread, and long-lived! and well deserved – I am new to vi and you saved me from torment. Thanks a ton!
Haha, glad to help, Ryan! This post does indeed seem timeless; each comment reminds me of that! :)
Haha…i see every few weeks someone stumbles across your helpful tip…
Saved me from some frustration…the power of google plus helpful people …. Thanks
Ahmed from South Africa
Haha, it never ceases to amaze me, Ahmed! :)
Thank you very much !
I can see I’m not alone :D
Have a good day.
You’re most welcome, Thierry! :)
Fantastic; this has been driving me nuts for two years; finally googled it… ding! Solution! Thanks! Cheers, Chris
Glad you found this, Chris! :)
YEAH!!! You’re THE MAN!!! thanks BRO!! cheers! :)
Haha, you’re welcome man. :) Cheers!
I knew there had to be a way out of CTRL+S hell. Thanks for putting this on the web. You’ve been a big help!
You’re most welcome, Matthew! Glad it helped! :)
Infinite props man, this was starting to piss me off hahaha.
Glad I could help, Nils! :D
And your post just keeps on giving …
Another satisfied customer – months of frustration has finally ended.
Thank you!
You’re most welcome, Kevin! Happy to oblige! :)