Use client-supplied window size again (Pasi Kallinen).

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
This commit is contained in:
Jilles Tjoelker 2004-03-04 13:30:12 +00:00
parent b3fb5538e8
commit 2f258f13c7
1 changed files with 8 additions and 4 deletions

View File

@ -1413,10 +1413,14 @@ main (int argc, char** argv)
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 ();