Skip to content

smelt.spinner

Tier: UiHost — Requires a terminal UI; calling these from headless mode raises.

Shared spinner glyph and cadence for plugin animations, plus a busy-token stack so long-running background work shows the status-bar spinner. UiHost-only.

smelt.spinner.busy

fun(label: string): smelt.Reg

Types: smelt.Reg

Push a busy token onto the per-app stack and return a Reg whose :remove() pops it. While any token is live, the status bar shows the spinner with the top token's label. Multiple plugins can hold tokens concurrently; the most recently pushed label wins.

smelt.spinner.busy_label

fun(): string?

Return the top busy-stack label, or nil when nothing is busy.

smelt.spinner.glyph

fun(): string

Return the current spinner glyph (single grapheme). Stays in sync with the status bar's working pill so plugin spinners animate together.

smelt.spinner.is_busy

fun(): boolean

Return true while at least one smelt.spinner.busy token is live.

smelt.spinner.period_ms

fun(): integer

Return the spinner frame period in milliseconds. Use as the redraw interval to match the built-in cadence.