[net.micro.att] 3B2 DMD layers software and curses

robert@gitpyr.UUCP (Robert Viduya) (07/05/85)

I've been using a DMD terminal on a 3B2 for a couple of months now and I've
always wondered how the layers system tells curses the size of the current
window.  It doesn't modify /usr/lib/terminfo/d/dmd (it can't and still have
the capability of having different size windows open), nor does it set the
TERMINFO environment variable to point somewhere else.  Setting TERMINFO
to point explicitly to /usr/lib/terminfo doesn't change anything.  It
still magically know how large the window is.  The only way I can see it
being done is to have the proper ioctls built in to the curses library
(I don't have source, so I can't check this).  Does anyone know exactly
how it's done?

				robert
-- 
Robert Viduya							01111000
Georgia Institute of Technology

...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert
...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert

heiby@cuae2.UUCP (Ron Heiby) (07/08/85)

In article <536@gitpyr.UUCP> robert@gitpyr.UUCP (Robert Viduya) writes:
> The only way I can see it being done is to have the proper ioctls built
> in to the curses library.

Yes, that's how it's done.
-- 
Ron Heiby	heiby@cuae2.UUCP	(via ihnp4)
AT&T-IS, /app/eng, Lisle, IL	(312) 810-6109

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (07/14/85)

> I've been using a DMD terminal on a 3B2 for a couple of months now and I've
> always wondered how the layers system tells curses the size of the current
> window.  It doesn't modify /usr/lib/terminfo/d/dmd (it can't and still have
> the capability of having different size windows open), nor does it set the
> TERMINFO environment variable to point somewhere else.  Setting TERMINFO
> to point explicitly to /usr/lib/terminfo doesn't change anything.  It
> still magically know how large the window is.  The only way I can see it
> being done is to have the proper ioctls built in to the curses library
> (I don't have source, so I can't check this).  Does anyone know exactly
> how it's done?

There is an ioctl(2) code, JWINSIZE, that returns into a

	struct jwinsize
	{
		char	bytesx, bytesy;	/* Window size in characters */
		short	bitsx, bitsy;	/* Window size in bits */
	};

the appropriate information, which has been set up by layers/xt or mpx/pty.
Word is that libcurses has the code that does this #ifdef'ed out in the
source, but including <sys/jioctl.h> suffices to enable the feature (of
course, you have to rebuild libcurses and everything that uses it).
Apparently your system has this libcurses feature enabled.