page mode in the tty driver

Mark Horton mark at cbosgd.UUCP
Tue Sep 3 06:32:34 AEST 1985


In article <302 at aphasia.UUCP> gww at aphasia.UUCP (George Williams) writes:
>One problem with pagination in the tty driver:
>    At caltech we have a network that lives between most computers and
>    most terminals, now unfortunately the network uses ^S/^Q (of course)
>    and any ^S, ^Q you type on your terminal will go to the network
>    not to the computer.  So putting pagination in the tty driver
>    really confuses novice users, the documentation says that pressing
>    ^Q gets things started again, but it doesn't.  Instead they have
>    to rummage arround, find the network documentation (which is not
>    written for novices) find that what they really want is ^P^Q.

There are many ways to implement page mode in the tty driver.  In UNIX,
it turns out to be very convenient to put it right next to the xon/xoff
code, which does a similar thing.  (This is the reason given by most of
the people who feel page mode should not be in the system, since xon/xoff
is implemented in each separate device driver rather than the tty driver
proper, you have to hack each new device driver to support page mode.
The same argument could be made that xon/xoff should not be supported by
the UNIX system either, but it's already there.)

If you do the quick-and-dirty page mode implementation, then typing ^Q
is one way to get it started again after you are at the bottom of a page.
However, this doesn't work well, if you have a terminal that uses xon/xoff
heavily, you may find the terminal sends the ^Q that lets it go on to the
next page when you weren't done reading the last one.

To do it properly, you have to present the interface that xon/xoff is a
flow control level used only by your terminal to keep its buffers from
overflowing.  Page mode, on the other hand, is a user visible feature
which is different from xon/xoff.  You use a different character (we
use space) to let it go another page.  Typing ^Q at a stopped page doesn't
do anything, but then typing ^Q when the system is prompting you for
input doesn't do anything either - your terminal might have sent the ^Q.

The problem of users getting confused doesn't really happen, because
(and this is the beauty of page mode) the users never need to know
about ^S/^Q!  Lunging for the ^S key to read something that's about
to go off the screen is not necessary, the system will stop automatically.
The users only need to know about the space bar, and since page mode is
set up so that ANY character (other than those eaten by the flow control
level) will wake it up, hung terminals never happen.  (By convention,
the character typed is still passed through to the program reading from
the tty, except that a space typed while stopped in page mode is tossed.)
I have yet to have any of our users get confused, nor do I ever find a
terminal hung waiting for a space.  And we have lots of users who are
new to the UNIX system here.

	Mark



More information about the Comp.unix.wizards mailing list