Scroll::Progress
The progress line drawn under the tail when --progress is on.
Two shapes, chosen by whether the input size is known:
unknown: 1.2M 12K ln 840K/s 1.2K ln/s NAME
known: 45% ███████░░░ 1.2M/2.6M eta 2m01s 840K/s 12K ln NAME
Counting happens on the hot path (see Counters), so the numbers are exact
even when the display drops chunks; the meter itself only formats.
Constants
Bytes scale by 1024, because that is what a byte size means. Counts of things scale by 1000, so a million lines reads as 1.0M and not 977K.
SGR bodies. The bar leans on background colors so the filled part and the track meet with no gap between glyphs.
Columns a name is worth giving up stats fields for. Below this the name is too clipped to identify anything.
Columns the bar wants before the name starts stealing from it, and the floor it will not go below while a name is present.
Rates are measured over a trailing window rather than the whole run, so a stalled stream shows a falling rate instead of a stale average.
A name too long for its field slides left at this rate, holds at the end, then restarts.
A byte size: an integer, or a decimal with a 1024-based suffix. Case insensitive, and an "i" and/or "b" may trail the suffix letter (1.5k, 1.5K, 1.5KB, 1.5KiB are the same size).
Constructors
Class methods
A bar width columns wide, done of it filled.
With color the filled part and the track are background colors, so they meet with no gap, and a unicode charset gives the leading cell one of the eighth-blocks for sub-column resolution. Without color there is no background to lean on and the bar falls back to glyphs.
The same shape, 1000-based and without the unit letter at the bottom: 512, 1.2K, 12K.
Fold the three size options into one total. A byte size always wins over a line count, and --size over --file-size; each loser is reported so the caller can warn about the option it ignored.
Strip the control bytes a name could otherwise smuggle into the display.
The window of name visible in a field width columns wide. A name that
fits is returned whole; a longer one slides left at SCROLL_RATE columns per
second, holds SCROLL_PAUSE at the end, then starts over.
Instance methods
How much of the input is done, or nil when the size is unknown. Public because the terminal's own indicator is driven from the same number.