do the resize signally properly

This commit is contained in:
Bill Currie 2001-09-25 20:35:37 +00:00
parent df330f33fd
commit 5195c065c6

View file

@ -69,6 +69,7 @@ static WINDOW *output;
static WINDOW *status;
static WINDOW *input;
static int screen_x, screen_y;
static int interrupted;
#define MAXCMDLINE 256
static inputline_t *input_line;
@ -111,7 +112,7 @@ C_ExecLine (const char *line)
static void
sigwinch (int sig)
{
ungetch (KEY_RESIZE);
interrupted = 1;
signal (SIGWINCH, sigwinch);
}
#endif
@ -231,17 +232,17 @@ C_ProcessInput (void)
int ch = wgetch (input), i;
const char *text;
switch (ch) {
case KEY_RESIZE:
{
if (interrupted) {
struct winsize size;
interrupted = 0;
if (ioctl (fileno (stdout), TIOCGWINSZ, &size) == 0) {
resizeterm (size.ws_row, size.ws_col);
wrefresh (curscr);
}
}
break;
switch (ch) {
case KEY_ENTER:
case '\n':
case '\r':