tui progress for viewers
Add a progress bar.
Command Type
built-in
Signature
> tui progress {flags} (source)
Flags
--value, -v {number}: Fixed value to show.--total, -t {number}: Value that fills the bar (default 1, or 100 for values above 1).--label, -l {string}: Text before the percentage.--id {string}: Widget id.--focus: Start with this widget focused.--data {any}: Data for this widget alone, instead of the outer pipeline's.--from {string}: Id of the table, tree, or select whose highlighted row drives this widget.
Parameters
source: Closure over the --from row that yields the value.
Input/output types:
| input | output |
|---|---|
| nothing | tui |
| tui | tui |
| any | tui |
Examples
A static bar at 40%
> tui progress --value 0.4 --label copying | tui debug | get screenA bar driven by a stream
> 1..100 | each {|n| sleep 50ms; $n } | tui progress --total 100 | tui runNotes
The bar shows --value, or otherwise reads its data: a number, a {value, total} record's value, or the last number in a list, so a streamed counter drives it live. Values above 1 are read out of --total (default 100).
With --from and a closure the bar follows another widget's highlighted row: tui progress --from table-0 {|row| $row.pct }.