Set screen width to 255 when terminal asks for more.
authorDavid Griffith <dave@661.org>
Fri, 26 Jan 2018 12:13:55 +0000 (04:13 -0800)
committerDavid Griffith <dave@661.org>
Fri, 26 Jan 2018 12:13:55 +0000 (04:13 -0800)
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

index 8d8affbe11acf2752b7b8af40cc756dbbc3c7636..3be38e5187e09bd4e1a5cd2f90a407ac9c990fff 100644 (file)
@@ -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;