On 2/10/21 11:59 AM, Koichi Murase wrote:
I'd also like to know how this is going to work with read -e and readline,
since those don't seem to know anything about the timer.
OK, that is a good point. I completely forgot about `read -e'. I took
a look at `rl_getc (stream)' (lib/readline/input.c). If one wants to
switch to this approach, the timeout needs to be specified for the
pselect(2) calls in `rl_getc ()'. In that case, I think readline could
provide a proper public interface to accept the setting of the
timeout. Because readline might be linked with different versions of
Bash, the handling of SIGALRM in readline can be left as is, but the
new interface for the timeout can be just added?
You'll have to hook the timeout code into the pselect/select calls, as you
suspect. Take a shot and it and send me what you come up with.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/