diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2016-06-20 23:29:15 -0700 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2016-06-22 18:32:15 -0700 |
commit | d9924b1eb8a80bc642340227aa92f276c3ac1d5d (patch) | |
tree | 3d3f40dd473ae1b7f73bcf0029ec6d13e8c41055 /src/tty.c | |
parent | 35cc756ae0a1e2c1f3d095711903012a520a561e (diff) |
Batch together input for searches
Diffstat (limited to 'src/tty.c')
-rw-r--r-- | src/tty.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); } |