Scroll::Renderer
Draws the tail window as a fixed-height region on the terminal, repainting it
in place each frame. The region is reserved once by scrolling (which pushes
any existing screen content up into scrollback rather than overwriting it),
and thereafter every frame is a single up-move, N cleared-and-rewritten rows,
and a move back to the top. No newline is ever emitted after the last row, so
the terminal never scrolls again and the region cannot drift or clobber
history. Lines are sanitized and truncated to one short of the terminal width
(never touching the last column, which can trigger auto-wrap). The raw stream
on STDOUT is never touched by any of this. With --progress the bottom row of
the region belongs to the progress line, and can be repainted on its own.
Constants
Constructors
progress reserves the bottom row of the region for the progress line.
size overrides the terminal size query (rows, cols); it exists so specs
can drive the renderer against an IO::Memory, which has no fd.
Class methods
Instance methods
Repaint the region. The cursor is assumed to rest at column 0 of the first region row, and is left there again when done.
Repaint only the progress row. Ticks where no new line arrived still move the rates, the ETA, and a scrolling name, and repainting one row instead of the whole region keeps that cheap.
Move the cursor below the region and show it, so a following shell prompt (or the shell after Ctrl-C) appears after the display rather than on top of it or wherever the cursor happened to rest. Idempotent and safe from an at_exit / signal handler: it runs at most once and swallows a dead terminal.
Hide the cursor and record the ceiling for the region height. The region is not reserved up front: it grows one row at a time as lines arrive, so a short stream never opens more rows than it has lines.
Columns a row may use: one short of the terminal width, since writing the last column can trigger auto-wrap.