From: Arun Prakash Jana Date: Sat, 12 Jun 2021 07:28:28 +0000 (+0530) Subject: Attempt to fix #1067: hook into ncurses to resize on KEY_RESIZE X-Git-Tag: v4.2~99 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=145ca91df24d63d18802b379398d203ff795fa29;p=nnn.git Attempt to fix #1067: hook into ncurses to resize on KEY_RESIZE --- diff --git a/src/nnn.c b/src/nnn.c index 351d7b51..ecb5888b 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1241,7 +1241,8 @@ static void clearoldprompt(void) { clearinfoln(); tolastln(); - addch('\n'); + clrtoeol(); + resize_term(0, 0); } #endif @@ -1250,7 +1251,7 @@ static inline void printmsg_nc(const char *msg) { tolastln(); addstr(msg); - addch('\n'); + clrtoeol(); } static void printmsg(const char *msg) @@ -2711,6 +2712,11 @@ try_quit: //DPRINTF_D(c); //DPRINTF_S(keyname(c)); +#ifdef KEY_RESIZE + if (c == KEY_RESIZE) + resize_term(0, 0); +#endif + /* Handle Alt+key */ if (c == ESC) { timeout(0); @@ -5839,7 +5845,7 @@ static void statusbar(char *path) } } - addch('\n'); + clrtoeol(); } attroff(COLOR_PAIR(cfg.curctx + 1));