summaryrefslogtreecommitdiff
path: root/term.c
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2017-06-06 19:42:34 -0400
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2017-06-06 19:42:34 -0400
commit57bc003fcfcd699dc11e7190d88173cc235994d9 (patch)
tree5f83e0f3cbec66c33a41bfbe7fd5393a48ba373b /term.c
parent8c15427214095ab11697a7505e168ada0e33cdbf (diff)
downloadsedt-57bc003fcfcd699dc11e7190d88173cc235994d9.tar.gz
sedt-57bc003fcfcd699dc11e7190d88173cc235994d9.zip
SEDT should now resize when the terminal does when compiled with curses on Linux
Diffstat (limited to 'term.c')
-rw-r--r--term.c39
1 files changed, 36 insertions, 3 deletions
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)