From f4f6919c02d46889800e74f70a82ef5ef80b9e46 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 13 Jun 2021 00:16:09 +0530 Subject: [PATCH] Fix #1067: handle SIGWINCH the ncurses way Ref: https://invisible-island.net/ncurses/ncurses-intro.html#xterm --- src/nnn.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index bd294834..d6ff427b 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1237,13 +1237,19 @@ static void clearinfoln(void) } #ifdef KEY_RESIZE +static void handle_key_resize() +{ + endwin(); + refresh(); +} + /* Clear the old prompt */ static void clearoldprompt(void) { clearinfoln(); tolastln(); clrtoeol(); - resize_term(0, 0); + handle_key_resize(); } #endif @@ -2722,7 +2728,7 @@ try_quit: #ifdef KEY_RESIZE if (c == KEY_RESIZE) - resize_term(0, 0); + handle_key_resize(); #endif /* Handle Alt+key */ -- 2.48.1