Skip to content

smelt.terminal

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

Visibility: Public - Stable Lua API intended for user config and plugins.

Terminal integration helpers. UiHost-only.

smelt.terminal.bell

fun(): boolean

Ring the terminal bell (BEL). Returns false when no interactive terminal is attached.

smelt.terminal.clear_title

fun(): boolean

Clear the terminal window/tab title using OSC 0 with an empty payload.

smelt.terminal.info

fun(): table

Return environment-derived terminal information: { term, term_program, color_term, platform, tmux, screen, ssh }.

smelt.terminal.is_focused

fun(): boolean

Return true when the smelt terminal window currently has OS focus.

smelt.terminal.osc9_notify

fun(message: string, opts: table?): boolean

Post an OSC 9 terminal notification with message. Pass { dcs_passthrough = true } inside tmux to wrap the notification for tmux passthrough. Control characters are stripped from messages before writing.

smelt.terminal.set_title

fun(title: string?): boolean

Set the terminal window/tab title using OSC 0. Pass nil to clear it. Control characters are stripped from titles before writing.

smelt.terminal.size

fun(): table

Return the current terminal size as { width, height } in cells.