Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another useful trick to remember if you're using Putty and you ever accidentally hit Ctrl-S and find that you've frozen the terminal.

Just type Ctrl-Q and you will unfreeze the connection.

Credit due to: http://raamdev.com/2007/recovering-from-ctrls-in-putty/



If you frequently hit Ctrl-S by accident, and don't consider this a feature, you can turn off XON/XOFF flow control using

   $ stty -ixon -ixoff
then Ctrl-S/Ctrl-Q will be normal characters without side-effects in your terminal, you'll probably just see (depending on shell, terminal, ...) ^S on your screen when you hit it.

To turn it on again, use

   $ stty ixon ixoff


I feel like I should have learned this years ago.


This is not news to anyone (in tech) over 40.

https://en.wikipedia.org/wiki/Software_flow_control


But the world is full of neophytes, re-inventors, etc. It's good to remind people periodically and educate the next generation.


And besides, the older I get (41) the more I can use frequent reminders of the things I used to know. It's disturbing the number of times I've searched the web for answers, and discovered an answer I wrote myself. And I hadn't known this could be easily turned off with 'stty' as suggested in another answer. Or maybe I did once know that?


The following quite becomes more relevant every year: "I've forgotten more than you'll ever know!" --Insulting Old Fogey


Of course. I was actually just expressing a feeling of nostalgia.


That wiki page doesn't mention tilde does it?

I know tilde escapes from cu(1) (part of uucp) http://www.delorie.com/gnu/docs/uucp/cu.1.html

But it may well have originated before then.


i'm turning 30 this year, have been dealing with this issue for 15 years, and still mini-panic for about 2 seconds whenever i hit ctrl-s by accident. it's good to read about.

chill out man.


Being a windows developer who dabbles in linux I accidentally smack ctrl+s a dozen times a day when vimming. I've only just recently got used to to recovery mechanism: Ctrl+q to recover the terminal, a stiff drink to recover my nerves.


From a comment above, I think you'll be able to put stty -ixon -ixoff in your .profile (or .bashrc or whatever) and ctrl+s/q won't be a problem anymore.


I think the implication was that there was a time when one frequently wanted to mess with the flow control.


WELL HOW ESL&^H^HLSE ARE YOU GOING TO READ A 25+ LINE FILE OTHER THAN MASHING CTRLQ BEFORE THE LINES SCROLL OFF THE SCREEN? BY READING THRE AFTERGLOW? I SUPPOSE YOU`VE ASL^H^HSLO GOT A DIRECT CONNECT MODEMS WHERE YOU CAN`T EVEN HEAR WHAT`S GOING ON. +++ATH...


i used to use it all the time on dialup connections. these days it's largely just a pain in the ass.


Thanks for that. In over 20 years I've never worked that one out :)



Thanks - much appreciated!

Despite being brought up on VT220's whacked in a VAX/Sun3 I never got my head around the details.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: