[net.unix-wizards] Terminal paging.

wcs@ho95b.UUCP (01/18/84)

The problem with "more" is not that application-level paging is
slow, it's that "more" is a huge, feature-rich program.  If you want
fast paging, the solution is not to hack the kernel, but to write a
simpler but faster more.  Our local comp center had a thing called
'pgr', which was dumb, but fast.  I can't broadcast the code, but the
basic idea went like this:

	while( (c=getchar()) != EOF ) {
		if ( c!= '\n' ) putchar(c);
		else {
		    if (++lines <23_or_so) putchar(c);
		    else {
			putc('^G');
			if ( (c=READ_FROM_TTY()) != '\n' )
				{do stuff}
			maybe putc('\n');
			}
		}

				Bill

gwyn%brl-vld@sri-unix.UUCP (01/21/84)

From:      Doug Gwyn (VLD/VMB) <gwyn@brl-vld>

I think most UNIX sites have come up with a terminal pager somehow.
The REALLY NIFTY new book by Brian Kernighan & Rob Pike has the code
for a paginator called "p", and UNIX System V Release 2 supplies "pg"
which is supposed to be ""more" and more", although I haven't seen
it yet.

phil%rice@sri-unix.UUCP (01/22/84)

From:  William LeFebvre <phil@rice>

I can't contain myself any longer....

I am in the process of writing a really slick terminal pager.  When I
started on it, I decided that it would be more than more, so I chose
the name "most".  What can I say?  Its biggest advantage over every
other terminal pager that I have seen is it understands that context
isn't limited to 24 (or whatever) lines.  It allows you to travel
backwards thru the text as well as forward -- even on standard input.
This convenience has its price -- it doesn't behave well on a non-paged
system.  That means it would probably croak on Sys V and such.  I don't
want to give it away yet, but I plan on giving it to whoever asks when
I feel that it is ready.  There are a few things that are missing right
now.  But, everyone at Rice uses it and loves it, even if there are
some things that it doesn't do.  So, if you can hold on to your paging
horses for awhile, "most" will be available.

                                William LeFebvre
                                ARPANet and CSNet: phil@rice
                                USENet:  ...!lbl-csam!rice!phil

dudek@utcsrgv.UUCP (Gregory Dudek) (02/17/84)

<>
  Personally, I don't really like the idea of terminal paging, and
in fact am usually happy with just ^S/^Q (although I never use a
terminal faster than 9600 baud).  For those who really want it though,
I wonder if it wouldn't be possible to hook it in as a user process
that would be "called" by the kernel.  A terminal preprocessor
 could be identified on a per-process basis.  This would allow
users to use a standard terminal pager, a unique one, or none at all.
  Clearly this would involve a certain overhead, but is it 
unacceptably large?  Several distributed file systems (eg. cocanet, I
think) use this type of extra-kernel service routine, and it seems
to work for them.
   Greg Dudek
   utcsrgv!dudek