From 2ca9e0059af86f1eb9aae90bdb4f7e0f8b3770ff Mon Sep 17 00:00:00 2001 From: David Griffith Date: Fri, 26 Jan 2018 04:13:55 -0800 Subject: [PATCH] Set screen width to 255 when terminal asks for more. The Z-machine design uses an 8-bit value to describe the number of columns on a terminal. At the time (late 1970s), this seemed like a reasonable limitation. Now some people are trying to use terminals (emulators really) this wide. --- src/curses/ux_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 8d8affb..3be38e5 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -459,9 +459,13 @@ void os_init_screen (void) h_screen_width = h_screen_cols; h_screen_height = h_screen_rows; - if (h_screen_width > 255 || h_screen_width < 1) + if (h_screen_width < 1) os_fatal("Invalid screen width. Must be between 1 and 255."); + /* Screen width is an 8-bit value in the Z-machine design itself. */ + if (h_screen_width > 255) + h_screen_width = 255; + h_font_width = 1; h_font_height = 1; -- 2.34.1