summaryrefslogtreecommitdiff
path: root/src/tty.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2018-09-09 21:02:45 -0700
committerJohn Hawthorn <john@hawthorn.email>2018-09-09 21:02:45 -0700
commit97ec6364e25070c73bf3331363a30aa61cfd21c9 (patch)
tree4b8fcb442655f8646145e6890e747ffbdf49fe0e /src/tty.c
parent22579efc0ad4386e888e08c485f9268619c1934d (diff)
parentbaa0d7ece4eb8401a61a0bebdb5264bf805a34c2 (diff)
Merge branch 'abort_on_escape'
Diffstat (limited to 'src/tty.c')
-rw-r--r--src/tty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tty.c b/src/tty.c
index a8f014e..b5b942c 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -87,9 +87,10 @@ char tty_getchar(tty_t *tty) {
}
}
-int tty_input_ready(tty_t *tty) {
+int tty_input_ready(tty_t *tty, int pending) {
fd_set readfs;
- struct timeval tv = {0, 0};
+ struct timeval tv = {0, pending ? 500000 : 0};
+ FD_ZERO(&readfs);
FD_SET(tty->fdin, &readfs);
select(tty->fdin + 1, &readfs, NULL, NULL, &tv);
return FD_ISSET(tty->fdin, &readfs);