TERMCAPs extensions...
VLD/VMB
gwyn at Brl-Vld.ARPA
Fri Apr 5 11:42:18 AEST 1985
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 <sys/ioctl.h> 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.
More information about the Comp.unix.wizards
mailing list