Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!gwyn@Brl-Vld.ARPA From: gwyn@Brl-Vld.ARPA (VLD/VMB) Newsgroups: net.unix-wizards Subject: Re: TERMCAPs extensions... Message-ID: <9739@brl-tgr.ARPA> Date: Thu, 4-Apr-85 20:42:18 EST Article-I.D.: brl-tgr.9739 Posted: Thu Apr 4 20:42:18 1985 Date-Received: Mon, 8-Apr-85 00:17:32 EST Sender: news@brl-tgr.ARPA Lines: 26 The trouble with such simple schemes is that window sizes change, and one would like to be able to find out the present window size at will. As a side-effect of Teletype 5620 DMD software development and probably Sun Microsystems work on windows, it appears that future releases of 4.nBSD will store window information in the terminal data structure and have ioctls for fetching and changing this information. Here is the interesting part of the 4.2+BSD file as it exists at BRL: /* ioctl.h 6.6 85/01/03 */ ... /* * Window size structure */ struct winsize { unsigned short row, col; /* character size of window */ unsigned short xpixel, ypixel; /* pixel size of window */ }; ... #define TIOCGWINSZ _IOR(t, 104, struct winsize) /* get window size */ #define TIOCSWINSZ _IOW(t, 103, struct winsize) /* set window size */ All our screen editors, paginators, etc. have been changed to fetch the window size, which is (0,0,0,0) if not known, and substitute it for the termcap co#,li#. Of course if the ioctl fails or if the window size has not been set, the termcap values are used.