# Pager

Pagers are a way to interactively control an IO stream. For now, there is only
one page implementation in text/pager. It's a "serial pager", that is, the
lowest common denominator, paging-wise. It doesn't require a Grid and simply
inserts a "Next page..." line at regular intervals, waiting for user input
before continuing. Pressing any key shows the next page, pressing ESC calls
"abort" (this generally returns to prompt).

The page works through the "page" word. For example:

    page console :self file :spit

This will spit the currently active file to the console while paging. This works
by temporarily overriding "console writeio" with a line counter.

The trick is to know when to remove that override: we only want "page" to affect
the command we're about to run, not to begin paging the console forever.

To do this, we use the Idle loop (sys/loop). That is, we add a pager removal
word in the the idle loop, which will be called as soon as we return to
interactive prompt.

This means that the pager will not play well with any word that calls the idle
loop. When that becomes a real problem, we'll think of something...

## API

pagerthreshold  Value holding the number of lines the pager accepts before
                showing its "Next page..." prompt. Default is 20.

page ( -- )
  Make the console page until the next idle loop runs.
