diff options
author | John Hawthorn <john@hawthorn.email> | 2018-09-09 20:53:50 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2018-09-09 21:11:26 -0700 |
commit | 7fa5050b40c7dcb6ec3ddd9395cbc694303807fe (patch) | |
tree | 64ff84393c9a17b081ed82dc8d0d8452afe1418b /src/tty.c | |
parent | 97ec6364e25070c73bf3331363a30aa61cfd21c9 (diff) |
Reduce ambiguous char wait time to 25ms
Diffstat (limited to 'src/tty.c')
-rw-r--r-- | src/tty.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -9,6 +9,8 @@ #include "tty.h" +#include "../config.h" + void tty_reset(tty_t *tty) { tcsetattr(tty->fdin, TCSANOW, &tty->original_termios); } @@ -89,7 +91,7 @@ char tty_getchar(tty_t *tty) { int tty_input_ready(tty_t *tty, int pending) { fd_set readfs; - struct timeval tv = {0, pending ? 500000 : 0}; + struct timeval tv = {0, pending ? (KEYTIMEOUT * 1000) : 0}; FD_ZERO(&readfs); FD_SET(tty->fdin, &readfs); select(tty->fdin + 1, &readfs, NULL, NULL, &tv); |