Skip to content

smelt.prompt

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

The main editable input surface: win handle, text get/set, and cursor control. UiHost-only.

smelt.prompt.remove_section

fun(name: string): nil

Remove the named prompt section. No-op if the section does not exist.

smelt.prompt.set_section

fun(name: string, content: string): nil

Set the named prompt section (e.g. selection context, attached files) to content. Sections render above the editable text and are submitted with the next turn.

smelt.prompt.set_text

fun(text: string): nil

Replace the prompt buffer with text. The cursor lands at the end and undo state is reset.

smelt.prompt.text

fun(): string

Return the prompt input buffer's current text. Internal attachment markers are stripped — plugins see only the user-visible characters.

smelt.prompt.win

fun(): smelt.win.Win

Types: smelt.win.Win

Return a Win handle for the prompt input. Use win:key(...) and win:on(...) to attach plugin behaviour.