Subject: strange termios behaviour
To: None <current-users@NetBSD.ORG>
From: Brett Lymn <>
List: current-users
Date: 08/05/1997 20:53:40
        I have been fooling around with libcurses to try and get in
some of the nicer features from the SYSV style curses, particularly
doing function key interpretation.  I have that working nicely but I
wanted to round out the implementation and do the notimeout/nodelay
functions.  I have done the fixes to make these things work but the
code is not doing the correct thing.  If I turn off notimeout, this
sets the VMIN to 0 and VTIME 2 (200mS timeout) in the termios
structure.  Now, if I press a function key all goes well and the key
gets assembled _but_ if I let the termios timeout expire, say by
pressing an escape key and waiting then any subsequent reads _always_
immediately return -1 (NOT 0 as per Case C of the termios manual!).
The odd thing is that I know someone who is testing my code for me (Hi
Julian :) on a 1.2.1 box and they do not see this problem, the timeout
does the right thing.

Also, nodelay does not work - this sets VMIN to 0 and VTIME to 0 in
the termios structure.  In this case the read always returns -1 (Not 0
as per case D of the termios manual).  This behaviour is consistent
between my machine & 1.2.1.

Anyone got any ideas?

BTW my machine is running a current that is a few days old on the i386

ABTW If anyone wants the patches to libcurses I will be happy to
oblige.  When I can get the notimeout/nodelay stuff sorted out I shall
be doing a sendpr.

Brett Lymn, Computer Systems Administrator, British Aerospace Australia
  What do you get when you cross a cantaloup with a dog?        Melancholy :-P