Pagination in TTY driver

Henry Spencer henry at utzoo.UUCP
Wed Aug 28 02:48:30 AEST 1985


> 		What about terminals that don't have 24 lines ? Some have
> 16 and some have 66 ? Do you have yet another ioctl() ?

The size is of course set by ioctl, since no way would we consider
imbedding something like that into the kernel.

> 		What happen when you print lines that wrap around the screen ?
> Does the kernel know how to count character spacing, know the screen width,
> whether the terminal has AM and XN and account for it when making page breaks ?

This is somewhat of a headache.  The kernel is *already* counting character
spacing, please note, so that's not an issue.  It gets it right for the
simple cases, and most non-simple cases want to use CBREAK mode anyway.
The ioctl includes an indication of screen width.  The AM/XN mess is not
yet fully accounted for, although there's nothing impossible about doing so.
(Before people start moaning about how unUnixish it is to put such things
into the kernel, check out the definition of newline delay type 1.  Such
details of terminal handling have a long history of being in the kernel!)

> 		The better pagers allow reverse and forward viewing. I find
> this capability indispensible. Do you plan to add a buffer in the kernel to
> allow reviewing of previous lines ?

This, we have not done; it would be a major added complication.  We find
the in-kernel pager very useful without it.  We agree that the in-kernel
pager is not the answer to all mankind's problems, or even all Unix's
pagination problems.  We are not convinced that "more" and its kin do in
fact represent such an answer, either!

> 		Does your implementation handle well situations where the
> application is sending more than 24 lines but since it is using cursor
> addressing, it is self consistent ? Does your kernel recognize cursor motion
> sequences or do you have to turn off paging every time you run such an
> application ? (e.g. graphics, some screen editors) Maybe you expect such
> applications to run in RAW or CBREAK and don't do paging in those modes, or
> maybe you expect such applications to shut off paging themselves.

Our experience has been that such applications invariably run in CBREAK
or RAW; paging is applicable only to COOKED mode.  This was a slightly
ad-hoc decision that has worked very well in practice.	We are opposed on
principle to having an unbounded number of programs know about paging.

>		Yes, I know paging works fine for many situations.

That it does.  We do still have explicit pager programs, but they get far
less use nowadays.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.unix.wizards mailing list