Skip to content

smelt.statusline

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

Register/unregister statusline sources and snapshot composer state. UiHost-only.

smelt.statusline.register

fun(name: string, handler: fun(value: table): table, opts: smelt.statusline.RegisterOpts?): smelt.Reg

Types: smelt.statusline.RegisterOpts, smelt.Reg

Register a Lua statusline source named name. The handler is called once per refresh and returns a single segment table or a list. Each segment is { text, style_group?, style?, priority?, align_right?, truncatable?, separated? }: style_group names a theme group whose resolved style applies (e.g. "SmeltModePlan"); style is a StyleDecl overlay applied on top. Higher priority drops first; truncatable shrinks with before being fully dropped; separated inserts · before this segment. opts.align = "right" makes the source's segments default to the right strip; later registrations replace earlier ones with the same name. Returns a Reg whose :remove() drops the source.

smelt.statusline.snapshot

fun(): table

Return the statusline state in one table per refresh: working/throbber, vim, mode, permission_pending, running_procs, running_agents, task_label, settings, and position. Styles are not projected — name a style_group on each segment instead. Returns an empty table when the app pointer is unavailable.

smelt.statusline.unregister

fun(name: string): nil

Drop the statusline source registered under name. No-op if no such source exists.