From f3938061b90c0cdd2ce14f606dcc7abd04e7a457 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 7 Apr 2022 12:56:21 -0400 Subject: [PATCH] Redraw when window size changes --- bb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bb.c b/bb.c index 05f8f2b..7b9f132 100644 --- a/bb.c +++ b/bb.c @@ -317,7 +317,11 @@ static void handle_next_key_binding(bb_t *bb) binding_t *binding; do { do { + struct winsize prevsize = winsize; key = bgetkey(tty_in, &mouse_x, &mouse_y); + // Window size changed while waiting for keypress: + if (winsize.ws_row != prevsize.ws_row || winsize.ws_col != prevsize.ws_col) + bb->dirty = 1; if (key == -1 && bb->dirty) return; } while (key == -1);