Subject: libedit
To: None <netbsd-users@netbsd.org>
From: Anthony Mallet <anthony.mallet@ficus.yi.org>
List: netbsd-users
Date: 09/23/2001 20:03:04
I'm trying to move an application from readline to libedit.
The difficult part is that my app must handle events in the background,
typically when no characters are available from the terminal.

I did this with readline quite easily with the two hooks the library
provides: rl_startup_hook and rl_getc_function.
The first hook sets the terminal in non-blocking mode and the second one
does the job of reading a character (setting it overwrites the internal
realine hook). Since the terminal is in non-blocking mode I can process
events if a call to read() returns EWOULDBLOCK.

At the moment, I feel like libedit is lacking this feature of readline.
el_gets() calls the hardcoded function read_char and el_getc() seems to
insist on reading a char in blocking mode (eventually reconfiguring the
terminal is a read() returns EWOULDBLOCK). 

Any hints?