PrivateactivePrivatebarPrivate ReadonlybarPrivatedetailsPrivate ReadonlypaintPrivate ReadonlyrefreshPrivaterenderedPrivatespinnerPrivate ReadonlystreamPrivate OptionaltimerPrivate ReadonlytrackerWhether the target stream is a TTY, i.e. whether an animated bar makes sense at all. Callers typically also consider CI/verbose-logging conditions before choosing to render one.
PrivateapplyOptionalstate: ProgressBarStatePrivatecomposePrivatecomposePrivatecursorEscape sequence that returns the cursor from the end of the last rendered line back to column 0 of the block's first line, ready for a clear-and-redraw.
PrivateerasePrint a line above the live block, then redraw the block beneath it. When the bar is not active the line is written as-is.
Redraw from the current tracker/details state. Use this after mutating a shared tracker.
PrivaterenderPrivaterenderPrivaterenderPrivaterestoreRestore the cursor on abrupt process exit (e.g. Ctrl-C) so the terminal is not left without a cursor when the bar never got a chance to stop cleanly.
Private ReadonlyrestoreShow the bar and start animating. Hides the cursor and begins the refresh loop.
Optionalstate: ProgressBarStateStop animating, erase the block and restore the terminal. Optionally prints a final line where the block was.
OptionalfinalLine: stringPrivatetickUpdate the underlying tracker/details and redraw. No-op when the bar is not active.
Privatewrite
An animated, multi-line progress bar that sticks to the bottom of a terminal: a gauge line (with spinner, percentage, count, throughput and ETA/elapsed) plus any number of caller-supplied summary lines. The whole block is redrawn in place on each tick, so the summary lines act as a live, compact dashboard rather than scrolling output.
The bar is a pure renderer over a ProgressTracker — it carries no global state, so multiple independent bars can exist (though only one should own a given stream at a time). It uses raw ANSI escapes and has no third-party dependencies; colour is auto-detected from the stream and honours
NO_COLOR/FORCE_COLOR.Example