]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #1067: handle SIGWINCH the ncurses way
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 12 Jun 2021 18:46:09 +0000 (00:16 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 12 Jun 2021 18:46:43 +0000 (00:16 +0530)
Ref: https://invisible-island.net/ncurses/ncurses-intro.html#xterm

src/nnn.c

index bd294834396aa3dcf7035a58ebf18368cd000eed..d6ff427bc11862e28d0833d6fc03c93aac0ced2c 100644 (file)
--- 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 */