summaryrefslogtreecommitdiff
path: root/src/tty.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2016-06-20 23:29:15 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2016-06-22 18:32:15 -0700
commitd9924b1eb8a80bc642340227aa92f276c3ac1d5d (patch)
tree3d3f40dd473ae1b7f73bcf0029ec6d13e8c41055 /src/tty.c
parent35cc756ae0a1e2c1f3d095711903012a520a561e (diff)
Batch together input for searches
Diffstat (limited to 'src/tty.c')
-rw-r--r--src/tty.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tty.c b/src/tty.c
index bf2bc83..97ac2ab 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -86,6 +86,14 @@ char tty_getchar(tty_t *tty) {
}
}
+int tty_input_ready(tty_t *tty) {
+ fd_set readfs;
+ struct timeval tv = {0, 0};
+ FD_SET(tty->fdin, &readfs);
+ select(tty->fdin + 1, &readfs, NULL, NULL, &tv);
+ return FD_ISSET(tty->fdin, &readfs);
+}
+
static void tty_sgr(tty_t *tty, int code) {
tty_printf(tty, "%c%c%im", 0x1b, '[', code);
}