up vote 7 down vote favorite
2
share [g+] share [fb]

I do a lot of ssh-ing, and periodically I hit Ctrl+S, which naturally sends an XOFF, and causes all kinds of problems (not to mention it takes a while for me to figure out what happened, then another while to remember that I need to press Ctrl+Q to recover.

I would much rather instruct Putty to never ever let me type XOFF.

Any ideas?

link|improve this question
2  
+1 for pointing out that recovery is possible with Ctrl+Q. Helped me a lot! – Demento Apr 21 '11 at 17:49
feedback

3 Answers

up vote 6 down vote accepted

Don't know about Putty, but you can use:

stty -ixon

on remote host, to disable START/STOP signals.

link|improve this answer
Thanks - any idea if or how this affects the console? Would it alter the behavior of shell programs? (The only thing I know about XON/XOFF is that it's used for serial flow control). Sounds like a good setting for .bash_profile. – Seth Mar 29 '10 at 16:57
That should be stty -ixon. – Oddthinking Feb 16 '11 at 1:44
Sorry. Updated my post to fix the typo. – Bartosz Feb 22 '11 at 11:43
As I just commented to BlakBat on his answer, that makes ^S not send an XOFF, but it now puts me into i-search mode. Is there a way I can get bash (or PuTTY) just to discard any ^S? Even better would be if it could beep and/or flash at me ;o) – Owen Blacker Feb 14 at 15:06
feedback

The PuTTY solution:

  1. before creating the session go navigate to Connection->SSH->TTY in the list.
  2. in the "Mode" dropdown box, select IXON (nb: as of version 0.60, this list is not alphabetically ordered)
  3. put "0" (zero) as the value of IXON.

Screenshot

Works as a charm, even if you open up a "GNU screen" on top of it, SSH to another host, or "su" to another user

If you're using GNU Bash, ctrl-S should allow you now to do a forward-search-history (aka: i-search)

You can see the difference in the output of "stty -a | grep -o ".ixon": With putty configured it prints "-ixon", without " ixon"

link|improve this answer
Ok, that makes ^S not send an XOFF, but it now puts me into i-search mode. Is there a way I can get PuTTY (or bash) just to discard any ^S? Even better would be if it could beep and/or flash at me ;o) – Owen Blacker Feb 14 at 15:05
feedback

Open your .bash_profile and put:

stty -ixon

The value -xion doen't work for me. You can see the man entry: man stty.

link|improve this answer
+1 for stty -xion does not work on my centos, but stty -ixon works. – Jichao Dec 9 '10 at 16:18
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.