From 09754ed91243f497065d888d19fc7c3c63ce19a9 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 2 Feb 2020 02:28:14 -0500 Subject: Call reset_shell_mode on err This restores the terminal but doesn't clear the screen, so the error stays visible. --- ui.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui.c') diff --git a/ui.c b/ui.c index 11ee426..90ba726 100644 --- a/ui.c +++ b/ui.c @@ -124,6 +124,11 @@ static struct Window *windowFor(size_t id) { return window; } +static void errExit(int eval) { + (void)eval; + reset_shell_mode(); +} + void uiInit(void) { initscr(); cbreak(); @@ -131,6 +136,7 @@ void uiInit(void) { termInit(); termNoFlow(); def_prog_mode(); + err_set_exit(errExit); colorInit(); status = newwin(1, COLS, 0, 0); input = newpad(1, InputCols); -- cgit 1.4.1