diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/interestingtimes.c | 6 | ||||
-rw-r--r-- | lib/lib.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/interestingtimes.c b/lib/interestingtimes.c index 70fd4f9b..93e2ec52 100644 --- a/lib/interestingtimes.c +++ b/lib/interestingtimes.c @@ -110,6 +110,11 @@ int set_terminal(int fd, int raw, struct termios *old) return tcsetattr(fd, TCSANOW, &termio); } +void xset_terminal(int fd, int raw, struct termios *old) +{ + if (-1 == set_terminal(fd, raw, old)) perror_exit("bad tty fd#%d", fd); +} + struct scan_key_list { char *name, *seq; } static const scan_key_list[] = TAGGED_ARRAY(KEY, @@ -225,6 +230,7 @@ void tty_reset(void) fflush(0); } +// If you call set_terminal(), use sigatexit(tty_sigreset); void tty_sigreset(int i) { tty_reset(); @@ -224,6 +224,7 @@ int terminal_size(unsigned *xx, unsigned *yy); int terminal_probesize(unsigned *xx, unsigned *yy); int scan_key_getsize(char *scratch, int miliwait, unsigned *xx, unsigned *yy); int set_terminal(int fd, int raw, struct termios *old); +void xset_terminal(int fd, int raw, struct termios *old); int scan_key(char *scratch, int miliwait); void tty_esc(char *s); void tty_jump(int x, int y); |