From a0990b401c25ae7fc4a183ba87735413ab69467d Mon Sep 17 00:00:00 2001 From: Timo Korvola Date: Sat, 27 Jan 2018 19:51:29 +0200 Subject: [PATCH] Call endwin() if unix_get_terminal_size() has to punt. Curses must be very messed up at this point. Turn it off and hope something prints on our way out. This is 3505ee0d revived, as it got clobbered in the merge. --- src/curses/ux_init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 09fea50..fb491f8 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -389,8 +389,11 @@ void unix_get_terminal_size() else h_screen_cols = MIN(255, x); - if (h_screen_cols < 1) + if (h_screen_cols < 1) { + endwin(); + u_setup.curses_active = FALSE; os_fatal("Invalid screen width. Must be between 1 and 255."); + } h_font_width = 1; h_font_height = 1; -- 2.34.1