Terminal Paging

wcs at ho95b.UUCP wcs at ho95b.UUCP
Wed Jan 18 12:06:55 AEST 1984


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



More information about the Comp.unix.wizards mailing list