aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-23 15:14:46 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-23 15:14:46 +0000
commitc0a9f9e6b2519f70c98c217ba946d5ddca8a367b (patch)
treeaee6b633aebe7c8a2dfc1ce58aeed3ecfaf3604c
parentcsi: save and restore cursor when switching to and from alt screen (diff)
resize: bug: we're not in alt screen mode at startup
When we start up, the cells pointer, *and* the alt screen pointer are both NULL. Hence we incorrectly decided we were initially in alt screen mode.
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index d5786cc3..5a2dbc93 100644
--- a/main.c
+++ b/main.c
@@ -355,7 +355,8 @@ resize(struct context *c, int width, int height)
if (width == c->width && height == c->height)
return;
- bool alt_screen_active = c->term.grid.cells == c->term.grid.alt_grid;
+ bool alt_screen_active
+ = c->term.grid.cells != NULL && c->term.grid.cells == c->term.grid.alt_grid;
c->width = width;
c->height = height;