fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit dbdd93afea2b6bb42f6ae17c511b33a59bee63dd parent 5a0d76761d66280be063c63e26054bdf15b0c568 Author: John Hawthorn <john@hawthorn.email> Date: Sat, 15 Sep 2018 14:11:02 -0700 Switch to pselect Diffstat:
| M | src/tty.c | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/tty.c b/src/tty.c @@ -91,10 +91,12 @@ char tty_getchar(tty_t *tty) { int tty_input_ready(tty_t *tty, unsigned long timeout) { fd_set readfs; - struct timeval tv = {timeout / 1000, (timeout % 1000) * 1000}; FD_ZERO(&readfs); FD_SET(tty->fdin, &readfs); - select(tty->fdin + 1, &readfs, NULL, NULL, &tv); + + struct timespec ts = {timeout / 1000, (timeout % 1000) * 1000000}; + + pselect(tty->fdin + 1, &readfs, NULL, NULL, &ts, NULL); return FD_ISSET(tty->fdin, &readfs); }