[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] Control + S lockup.



Quoting Matthew Nuzum <cobalt@xxxxxxxxxxxxx>:
> Whenever I use pico, pressing Ctrl+s causes the SSH session to stop
> responding.  No subsequent key sequence that I can think of will fix
> this.  I do not have this problem on my RH7.1 server, so I'm not sure
> what the cause is.

This is something a UNIX old-timer like myself can help out with.

Control-S is part of an old line discipline, which specifies that ^S is
the XOFF code, and ^Q is XON.  (This is actually the definition of these
codes in the ASCII standard.)  Many TTY line drivers interpret ^S as
a request to suspend output, while ^Q will resume.

This behaviour is of course configurable.  Try this command:

stty -a

This shows the terminal line settings, and on my system produces output
like this:

bash# stty -a
speed 38400 baud; rows 49; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = 
<undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -
iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt 
echoctl echoke
bash# 

As you see, start = ^Q and stop = ^S.  You can change this with the stty
command, which you can place in your .profile.

stty stop ''

This will unbind the ^S from the stop function.  You can set it back
with:

stty stop '^S'   (to enter control S, use control V then control S)

Normally, a program like EMACS will change the tty settings itself, so that ^S 
and ^Q aren't intercepted by the line driver.  Use man stty for more info.

Anyway, if anyone else has a question about UNIX's history, feel free to ask!

To make this somewhat on-topic for developers, feel free to check out the
termios man page, and refer to the IXON flag, which is used with c_iflag
in the tcsetattr() function.

cheers
Paul Gillingwater

*********************************
 Paul Gillingwater, BA, BSc, MBA
        Managing Director
 CSO Lanifex Unternehmensberatung 
 & Softwareentwicklung G.m.b.H.
      NEW BUSINESS CONCEPTS

E-mail:  paul@xxxxxxxxxxx
Tel:     +43(1)2198222-20
Fax:     +43(1)2198222-11
Mobile:  +43(699)1922 3085
Webhome: http://www.lanifex.com/
Address: Praterstrasse 60/1/2 
         A-1020 Vienna, Austria
*********************************