Promote reset (actually write a new one using the simple man 4 console_codes
terminal reset escape sequence) and add gettty() function to lib so terminal
gets reset even when we redirect stdout/stderr. (This is apparently the
expected behavior.)
diff --git a/lib/lib.h b/lib/lib.h
index 03a0570..54876b6 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -181,6 +181,7 @@
 int xpoll(struct pollfd *fds, int nfds, int timeout);
 
 // interestingtimes.c
+int xgettty(void);
 int terminal_size(unsigned *xx, unsigned *yy);
 int set_terminal(int fd, int raw, struct termios *old);
 int scan_key(char *scratch, char **seqs, int block);