buffering woes

Lennart Augustsson lennart@augustsson.net
Wed, 05 Feb 2003 19:52:30 +0100


Malcolm Wallace wrote:

>Hal Daume III <hdaume@ISI.EDU> writes:
>
>  
>
>>Not for me, GHC 5.04.2 (Solaris).
>>
>>here it goes right the first time, but then i have to type two more
>>letters (in this case 'b\n') to get it to respond to "hello".
>>    
>>
>
>Solaris has a slightly bizarre buffering scheme in "raw" terminal
>mode, whereby it buffers 4 characters at a time, instead of passing
>on each character immediately.  Try
>
>    stty -icanon min 1
>
>(or something similar) to fix it?
>  
>
Someone must have failed setting the tty mode. :-)
The 4 is (if I remember right) the VMIN value which is stored in the
same place as the EOF (^D = 4) character.  It has to be set to 0 when
placing the tty in raw mode.

    -- Lennart