From a02644ef5c685a60dc56aa758843a7d6815862a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 27 Nov 2016 11:04:09 +0100 Subject: ui: remove terminal restore code This is already taken care of by libtermkey. Also we did not check whether we actually had a valid state to restore. --- ui-curses.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ui-curses.c b/ui-curses.c index 4e07e4c..b0422e4 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -84,7 +84,6 @@ typedef struct { int width, height; /* terminal dimensions available for all windows */ enum UiLayout layout; /* whether windows are displayed horizontally or vertically */ TermKey *termkey; /* libtermkey instance to handle keyboard input (stdin or /dev/tty) */ - struct termios tio; /* terminal state to restore before exiting */ } UiCurses; struct UiCursesWin { @@ -1016,7 +1015,6 @@ __attribute__((noreturn)) static void ui_die(Ui *ui, const char *msg, va_list ap endwin(); if (uic->termkey) termkey_stop(uic->termkey); - tcsetattr(STDERR_FILENO, TCSANOW, &uic->tio); vfprintf(stderr, msg, ap); exit(EXIT_FAILURE); } @@ -1123,7 +1121,6 @@ static bool ui_init(Ui *ui, Vis *vis) { if (!term) term = "xterm"; - tcgetattr(STDERR_FILENO, &uic->tio); errno = 0; if (!(uic->termkey = ui_termkey_new(STDIN_FILENO))) { /* work around libtermkey bug which fails if stdin is /dev/null */ @@ -1206,6 +1203,5 @@ void ui_curses_free(Ui *ui) { endwin(); if (uic->termkey) termkey_destroy(uic->termkey); - tcsetattr(STDERR_FILENO, TCSANOW, &uic->tio); free(uic); } -- cgit v1.2.3