46

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?

Seth
  • 1,037

6 Answers6

36

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

stty -ixon

on remote host, to disable START/STOP signals.

Bartosz
  • 484
34

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"

BlakBat
  • 1,279
4
.bashrc example:
#
# Stop Putty from doing XOFF/XON with Ctrl-S/Ctrl-Q
# SOURCE: http://raamdev.com/recovering-from-ctrls-in-putty (Morgy, 7/14/08)
#
# stty ixany
# stty ixoff -ixon
### If needing to listen to Ctrl-S for some apps, use these two instead:
stty stop undef
stty start undef
4

I've got the opposite problem. Every once in a while, the host sends an XOFF to PuTTY but never sends the corresponding XON to PuTTY. In this case, nothing you do to PuTTY (short of restarting it) will unwedge it. In this case, all keyboard input to the host is blocked, but the host can still send data to PuTTY.

Disabling flow control in PuTTY doesn't work.

The way to fix this problem is to use

stty -ixoff

in your .profile. This prohibits the host from sending XON/XOFF. Note that the names of the options are totally confusing. ixon/-ixon means enable/disable flow control on the client side (meaning that the client can't issue flow control), ixoff/-ixoff means enable/disable flow control on the host side (meaning the host can't issue flow control).

Btw, the ASCII code for Ctrl-S and XOFF are the same ASCII character (code 19, 0x13). There's no difference. The settings change the interpretation of that ASCII character.

Mark Lakata
  • 9,588
3

Open your .bash_profile and put:

stty -ixon

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

Gareth
  • 19,080
Fids
  • 39
-1

Run this command in terminal to disable it for current session/add it to .bashrc for disabling it permanently

stty -ixon