Fix #1067: handle SIGWINCH the ncurses way

Ref: https://invisible-island.net/ncurses/ncurses-intro.html#xterm
This commit is contained in:
Arun Prakash Jana 2021-06-13 00:16:09 +05:30
parent 4f977ff269
commit f4f6919c02
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -1237,13 +1237,19 @@ static void clearinfoln(void)
} }
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
static void handle_key_resize()
{
endwin();
refresh();
}
/* Clear the old prompt */ /* Clear the old prompt */
static void clearoldprompt(void) static void clearoldprompt(void)
{ {
clearinfoln(); clearinfoln();
tolastln(); tolastln();
clrtoeol(); clrtoeol();
resize_term(0, 0); handle_key_resize();
} }
#endif #endif
@ -2722,7 +2728,7 @@ try_quit:
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
if (c == KEY_RESIZE) if (c == KEY_RESIZE)
resize_term(0, 0); handle_key_resize();
#endif #endif
/* Handle Alt+key */ /* Handle Alt+key */