From: YANAGAWA Kazuhisa Date: 2006-07-07T21:17:04+09:00 Subject: Re: ruby-termios In Message-Id: <20060706215534.GD2241@eumel.yoo.local> Thorsten Haude writes: > oldterm = term > @logger.debug("c_lflag is #{term.c_lflag}") (snip) > term.c_lflag &= ~(Termios::ECHO | Termios::ICANON) > @logger.debug("c_lflag is #{oldterm.c_lflag}") (snip) > Why are the two flags different? Since YOU clear ECHO and ICANON. Note both oldterm and term are pointing a same Termios structure. > Second, some buffering is going on. If I enter a character, the program > blocks at the readchar. If I run this version of fetch() (snip) > ...the program blocks at lines 6 and 10 until I enter four characters. Then > all input is passed to the program, so for an invalid character the result > looks like this: Are you sure VMIN and VTIME are properly set? From termios(4) on NetBSD: Noncanonical Mode Input Processing In noncanonical mode input processing, input bytes are not assembled into lines, and erase and kill processing does not occur. The values of the VMIN and VTIME members of the c_cc array are used to determine how to process the bytes received. VMIN represents the minimum number of bytes that should be received when the read(2) system call successfully returns. VTIME is a timer of 0.1 second granularity that is used to time out bursty and short term data transmissions. (snip) Well, that's my wild guess.... -- kjana@dm4lab.to July 7, 2006 Time is illusion, life is confusion.