fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit a19b0f263bec7cb7916b1d81d28c9cdb1bcf047d
parent d9be156f9ef47b09636f2c14f1e07b6def7dfec7
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Tue, 16 Sep 2014 19:00:09 -0700

Abort on any tty errors

Diffstat:
Mtty.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tty.c b/tty.c @@ -16,9 +16,11 @@ void tty_reset(tty_t *tty){ void tty_init(tty_t *tty, const char *tty_filename){ tty->fdin = open(tty_filename, O_RDONLY); tty->fout = fopen(tty_filename, "w"); - setvbuf(tty->fout, NULL, _IOFBF, 4096); + if(setvbuf(tty->fout, NULL, _IOFBF, 4096)) + perror("setvbuf"); - tcgetattr(tty->fdin, &tty->original_termios); + if(tcgetattr(tty->fdin, &tty->original_termios)) + perror("tcgetattr"); struct termios new_termios = tty->original_termios; @@ -29,7 +31,8 @@ void tty_init(tty_t *tty, const char *tty_filename){ */ new_termios.c_lflag &= ~(ICANON | ECHO); - tcsetattr(tty->fdin, TCSANOW, &new_termios); + if(tcsetattr(tty->fdin, TCSANOW, &new_termios)) + perror("tcsetattr"); tty_getwinsz(tty);