terminal
The terminal namespace — the engine's Luau API reference for terminal.
The terminal namespace — 8 functions.
terminal/create
terminal.create(title)
Allocate a terminal (an empty vt100 grid, no process yet) and return its id. Render it with Z.terminal(id); run a process in it with terminal.spawn.
terminal/destroy
terminal.destroy(id)
Kill the child (if any) and remove the terminal from the registry.
terminal/kill
terminal.kill(id)
Terminate the terminal's child process, if running. Raises with no PTY backend.
terminal/list
terminal.list()
List live terminals as { {id: number, title: string, running: boolean} }.
terminal/poll
terminal.poll()
Drain one-shot lifecycle events as { {id: number, event: string, note: string} }. event is "exited" when a child ends; the Agents tab reads this to offer relaunch.
terminal/resize
terminal.resize(id, rows, cols)
Request a PTY resize (rows x cols). The widget resizes automatically; this is for programmatic sizing. Raises with no PTY backend.
terminal/spawn
terminal.spawn(id, opts)
Open a PTY and run a process in terminal id. opts = {cmd, args?, cwd?, env?, envRemove?} — the full process spec; the engine has no knowledge of what runs. Editor profile only: a shipped runtime never spawns host processes. Raises on platforms with no PTY backend (web).
terminal/write
terminal.write(id, bytes)
Queue keystroke bytes to the terminal's PTY (programmatic input; routine typing flows through the focused Z.terminal widget). Raises with no PTY backend.