People have already implemented text-file scrollers, and one could either adapt that code for stdin, or just add another 10-15 lines to do it from scratch..

Cheers