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 --- sedt.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'sedt.c') diff --git a/sedt.c b/sedt.c index 1ad6192..4b0253e 100644 --- a/sedt.c +++ b/sedt.c @@ -161,6 +161,25 @@ void Fast Write_Rem() } } +#if defined(LINUX) +#ifndef KEY_RESIZE +int Do_Size; +void Handle_Resize(int val) +{ +#if defined(TERMCAP) + Phys_Length=Max_Length=Scr_Length = tgetnum ("li");/* get number of lines/columes from termcap */ + Phys_Width=Max_Width=Scr_Width = tgetnum ("co"); +#else + Phys_Length=Max_Length=Scr_Length=stdscr->_maxy; + Phys_Width=Max_Width=Scr_Width=stdscr->_maxx; +#endif + Do_Size=1; + Hdr_Changes=1; + Update_Flag=1; +} +#endif +#endif + void Fast Sedt_Init() {char S[80]; Cur_Buffer=0; @@ -185,6 +204,13 @@ void Fast Sedt_Init() B_Init(&Del); Set_Terminal(); Setup_Term(); + +#if defined(LINUX) +#ifndef KEY_RESIZE + signal(SIGWINCH, Handle_Resize); +#endif +#endif + Opt_Init(); #if !((defined(ATARI) & defined(GEM)) | ((defined(DOS) | defined(NT)) & (defined(Windows) | defined(TV)))) Newwindow(); -- cgit v1.2.3