Skip to main content

Module pager

Module pager 

Source
Expand description

Output pager for displaying large result sets.

Two modes:

  • Batch (page_content): write all content to temp file, open with pager.
  • Streaming (page_stream): pipe rows directly to less stdin. less stores received bytes in its own internal buffer and allows full backward scrolling. Data appears as it arrives; no polling required.

Pager resolution order:

  1. $PAGER environment variable (pipe mode — custom pager gets stdin)
  2. less with stdin pipe (less -R -S)
  3. more as fallback (pipe mode)
  4. Error if nothing available

Structs§

PagerWriter
A writable handle that streams rows to a pager.

Functions§

page_content
page_stream
Spawn a pager for streaming output, returning a PagerWriter to write rows into.