Try to detect broken clients and force them to 80x24.
This backs out the functional change in rev 247.
Passing through window size to watchers in a later commit.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@264
db0b04b0-f4d1-0310-9a6d-
de3e77497b0e
signal (SIGHUP, catch_sighup);
(void) tcgetattr (0, &tt);
- win.ws_row = 24;
- win.ws_col = 80;
- win.ws_xpixel = win.ws_col * 8;
- win.ws_ypixel = win.ws_row * 8;
+ if (-1 == ioctl (0, TIOCGWINSZ, (char *) &win) || win.ws_row < 4 ||
+ win.ws_col < 4) /* Rudimentary validity check */
+ {
+ win.ws_row = 24;
+ win.ws_col = 80;
+ win.ws_xpixel = win.ws_col * 8;
+ win.ws_ypixel = win.ws_row * 8;
+ }
/* get master tty just before chroot (lives in /dev) */
ttyrec_getpty ();