class

Scroll::TerminalProgress

Inherits Reference < Object

Drives the terminal's own progress indicator — the one a taskbar, dock icon, or tab decoration shows — with OSC 9;4:

ESC ] 9 ; 4 ; <state> ; <percent> BEL

State 1 carries a percentage, 3 means the run is indeterminate (no size to measure against), and 0 takes the indicator away. Only terminals that name themselves as implementing it are driven; a terminal that does not know the sequence can otherwise print the tail of it into the display.

Constants

INDETERMINATE = 3
NORMAL = 1
REMOVE = 0

Constructors

new(io : IO)
Source

Instance methods

clear

Take the indicator away, leaving the terminal as the run found it. Does nothing if nothing was ever reported, and is safe from an at_exit hook.

Source
report(fraction : Float64 | Nil) : Nil

Report fraction of the run done, or an indeterminate run when it is nil. A repeat of the same state is dropped: the indicator moves in whole percent, and the display ticks far more often than that.

Source