Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!sri-unix!rutgers!labrea!decwrl!pyramid!prls!mips!dce From: dce@mips.UUCP (David Elliott) Newsgroups: comp.unix.wizards Subject: Re: Window size in 4.3BSD and tset Message-ID: <688@quacky.UUCP> Date: Wed, 16-Sep-87 13:49:41 EDT Article-I.D.: quacky.688 Posted: Wed Sep 16 13:49:41 1987 Date-Received: Sat, 19-Sep-87 14:24:46 EDT References: <813@saturn.ucsc.edu> Reply-To: dce@quacky.UUCP (David Elliott) Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 81 Keywords: windows 4.3 tset In article <813@saturn.ucsc.edu> haynes@ucscc.UCSC.EDU (Jim Haynes) writes: >From looking at the code I see that login sets the window size >parameters to zero, and then tset sets them for the terminal >if they are zero to start with and are found in the termcap file. >The result of this is that if you change a terminal from 80-column >mode to 132-column mode and run tset, the window parameters stay >at 80 cols and vi continues to wrap around at the 80th column. >The user has to log out and log back in with the changed terminal >mode to get it to work 'properly'. > >Does anybody know why it should be this way, and why tset shouldn't >set the window parameters regardless of whether they were found to >be zero? It is pretty bogus behavior. I changed tset to have a -w option which forces setting of the window size, but I really think that tset should be leaving the window size alone. Before making any statements on this matter, people should consider terminals like the Ann Arbor Ambassador (various numbers of lines from 18 to 60), the Wyse 60 (24, 25, 42, or 43 lines by 80 or 132 columns), the Wyse 75 (80 or 132 columns), and the Graphon GO-235 (your call from 1 to 52 lines). People like to be able to change between terminal types on the fly, and tset is a good way to do this, except that, as Jim says, it screws up your life. Below is the patch to add the -w option. This may not be the best solution, but it will work until the world decides on the correct way. *** tset.c.old --- tset.c *************** *** 479,484 **** --- 479,485 ---- int DoVirtTerm = YES; /* Set up a virtual terminal */ int PadBaud; /* Min rate of padding needed */ int lines, columns; + int Force_size; /* Force setting of window size */ # define CAPBUFSIZ 1024 char Capbuf[CAPBUFSIZ]; /* line from /etc/termcap for this TtyType */ *************** *** 883,888 **** --- 884,893 ---- DoVirtTerm = NO; continue; + case 'w': /* set window size */ + Force_size = YES; + continue; + default: *p-- = NULL; fatal("Bad flag -", p); *************** *** 1180,1187 **** /* Set window size */ (void) ioctl(FILEDES, TIOCGWINSZ, (char *)&win); ! if (win.ws_row == 0 && win.ws_col == 0 && ! lines > 0 && columns > 0) { win.ws_row = lines; win.ws_col = columns; (void) ioctl(FILEDES, TIOCSWINSZ, (char *)&win); --- 1185,1192 ---- /* Set window size */ (void) ioctl(FILEDES, TIOCGWINSZ, (char *)&win); ! if (Force_size || (win.ws_row == 0 && win.ws_col == 0 && ! lines > 0 && columns > 0)) { win.ws_row = lines; win.ws_col = columns; (void) ioctl(FILEDES, TIOCSWINSZ, (char *)&win); -- David Elliott {decvax,ucbvax,ihnp4}!decwrl!mips!dce