From 9bffcf91bafd9e66f9baab90ca262b1f15c7db27 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Mon, 14 May 2018 15:25:21 +1000 Subject: [PATCH] Use main_screen->co instead of current_term->TI_cols as fallback width for never-visible windows Window management should be getting its idea of screen geometry from screens, rather than directly from the terminal. --- source/window.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/window.c b/source/window.c index 15c3e31..2cec2ed 100644 --- a/source/window.c +++ b/source/window.c @@ -419,11 +419,16 @@ void BX_add_to_invisible_list(Window *window) invisible_list->prev = window; invisible_list = window; window->prev = NULL; + window->visible = 0; + + /* Save the width of the screen the window was last on, to use for + * wrapping output while the window is hidden. + */ if (window->screen) window->columns = window->screen->co; else - window->columns = current_term->TI_cols; + window->columns = main_screen->co; window->screen = NULL; }