Call reset_shell_mode on err

This restores the terminal but doesn't clear the screen, so the error
stays visible.
master
C. McEnroe 2020-02-02 02:28:14 -05:00
parent c18dc35377
commit 09754ed912
1 changed files with 6 additions and 0 deletions

6
ui.c
View File

@ -124,6 +124,11 @@ static struct Window *windowFor(size_t id) {
return window; return window;
} }
static void errExit(int eval) {
(void)eval;
reset_shell_mode();
}
void uiInit(void) { void uiInit(void) {
initscr(); initscr();
cbreak(); cbreak();
@ -131,6 +136,7 @@ void uiInit(void) {
termInit(); termInit();
termNoFlow(); termNoFlow();
def_prog_mode(); def_prog_mode();
err_set_exit(errExit);
colorInit(); colorInit();
status = newwin(1, COLS, 0, 0); status = newwin(1, COLS, 0, 0);
input = newpad(1, InputCols); input = newpad(1, InputCols);