[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: resizing of terminals fails
From: |
Folkert van Heusden |
Subject: |
RE: resizing of terminals fails |
Date: |
Mon, 7 Apr 2003 22:20:37 +0200 |
> What happens when you resize the terminal? How does it fail?
Ok, I have the following signal-handler:
void do_resize(int s)
{
struct winsize size;
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &size) == 0)
{
terminal_changed = 1;
max_y = size.ws_row;
max_x = size.ws_col;
}
else
{
fprintf(stderr, "ioctl failed\n");
exit(1);
}
signal(SIGWINCH, do_resize);
}
so it gets the resolution from the terminal. That one works.
But then in my main-loop:
if (terminal_changed)
{
terminal_changed = 0;
if (resizeterm(max_y, max_x) == ERR)
{
fprintf(stderr, "problem resizeing
terminal\n");
exit(1);
}
touchwin(stdscr);
endwin();
refresh();
create_windows();
}
then it fails at the resizeterm!
Folkert