On 7/12/24 7:40 AM, Eli Zaretskii wrote:
I have a followup question. Currently, reading input with timeout basically doesn't work on MS-Windows, and the ability to find out how many characters are available for input is severely limited (the calling application can only know if one or more input characters are available, but not how many, and the timeout specification to wait for input to become available is ignored).My question is how important is it to support this on MS-Windows? The Posix implementation uses pselect and ioctl/fcntl and similar APIs, which won't work on MS-Windows, but there are ways of implementing the same functionality on Windows using alternative Windows-specific APIs. If these features are important to have, and their importance justifies making the sources use more #ifdef's and be slightly harder to read, I can work on adding them. Do you know if there are any applications which use Readline and can be built on Windows that need this functionality?
Hi, Eli. As you note, readline has had timeout support for forever, and Windows has never supported it. That means things like bash `read -e -t' don't work very well, or have to be implemented outside readline using something like SIGALRM. The current readline timeout implementation is new in readline-8.2, so I don't know whether or not there are applications using it. It was inspired by similar changes to bash, which used to use SIGALRM for its read timeouts, and intended to provide a way for applications to use readline timeouts without having to hijack SIGALRM. If you want to read the discussion around it, start with https://lists.gnu.org/archive/html/bug-bash/2021-02/msg00059.html 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/
OpenPGP_signature.asc
Description: OpenPGP digital signature