From 57bc003fcfcd699dc11e7190d88173cc235994d9 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Tue, 6 Jun 2017 19:42:34 -0400 Subject: SEDT should now resize when the terminal does when compiled with curses on Linux --- term.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'term.c') diff --git a/term.c b/term.c index ba0e55a..78055d6 100644 --- a/term.c +++ b/term.c @@ -3293,7 +3293,34 @@ void Fast Conin() #if defined(TERMCAP) Character=UGetrm(); #else - Character=getch(); + do { + Character=getch(); + +#ifdef KEY_RESIZE + if(Character == KEY_RESIZE) + Do_Size=1; +#endif + + /* May be called if SIGWINCH fired */ + if(Do_Size == 1) { + Phys_Length=Max_Length=Scr_Length=stdscr->_maxy+1; + Phys_Width=Max_Width=Scr_Width=stdscr->_maxx+1; + endwin(); + + refresh(); + clear(); + Refresh(); + S_Header(); + Do_Size = 0; + Character=ERR; + } + +#ifdef KEY_MOUSE + if(Character == KEY_MOUSE) + Character = ERR; +#endif + + } while(Character==ERR); #endif #if defined(UNIX) Saved_Character=Character; @@ -3683,8 +3710,14 @@ void Fast Setup_Term() nonl(); cbreak(); noecho(); - Max_Length=Scr_Length=stdscr->_maxy; - Max_Width=Scr_Width=stdscr->_maxx; + +#ifndef KEY_RESIZE + /* For nonblocking getch() - unneeded if KEY_RESIZE is a thing */ + timeout(0); +#endif + + Max_Length=Scr_Length=stdscr->_maxy+1; + Max_Width=Scr_Width=stdscr->_maxx+1; #endif #endif #if defined(VMS) -- cgit v1.2.3