tui log for viewers
Add an append-only log view. Streamed rows appear at the bottom.
Command Type
built-in
Signature
> tui log {flags} (source)
Flags
--max-lines {int}: Keep only the last N lines (default 10000).--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 source row whose output is shown.
Input/output types:
| input | output |
|---|---|
| nothing | tui |
| tui | tui |
| any | tui |
Examples
Live log of a slow stream
> 1.. | each {|n| sleep 100ms; $"tick ($n)"} | tui label --title "ticks" | tui log | tui runNotes
Follows the tail as new items arrive. Mouse wheel and Up/Down scroll; scrolling up pauses follow until you hit the bottom again. --max-lines keeps that many newest lines in the view. Streamed rows share a global store capped at max(10000, --max-lines).
With --from and a closure the log shows the closure's output for the highlighted row of another widget, e.g. tui log --from table-0 {|row| open $row.name | lines }.