about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-02 02:28:14 -0500
committerJune McEnroe <june@causal.agency>2020-02-02 02:28:14 -0500
commit09754ed91243f497065d888d19fc7c3c63ce19a9 (patch)
tree75e2aec37d8532a5f566410801956d45740b277d
parentWrap before the very edge of the screen (diff)
downloadtest-09754ed91243f497065d888d19fc7c3c63ce19a9.tar.gz
test-09754ed91243f497065d888d19fc7c3c63ce19a9.zip
Call reset_shell_mode on err
This restores the terminal but doesn't clear the screen, so the error
stays visible.
-rw-r--r--ui.c6
1 files changed, 6 insertions, 0 deletions
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);
w=1'>Add The Bone Shard EmperorJune McEnroe 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe