Call endwin() if unix_get_terminal_size() has to punt.
authorTimo Korvola <tkorvola@iki.fi>
Sat, 27 Jan 2018 17:51:29 +0000 (19:51 +0200)
committerTimo Korvola <tkorvola@iki.fi>
Sat, 27 Jan 2018 18:27:32 +0000 (20:27 +0200)
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

index 09fea504d84dbca107e60c9a250d6a9a3c614fec..fb491f837c97df187dda38e9774b42b7336804de 100644 (file)
@@ -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;