ReadonlyelementRoot DOM element owned by the terminal.
ReadonlygeometryThe current grid and device-pixel backing-surface dimensions.
ReadonlyrendererActive renderer and text-shaping information.
ReadonlythemeCurrent authored theme. Missing properties inherit from DEFAULT_THEME.
Blurs the terminal input element.
Clears the active text selection.
Connects PTY byte streams with backpressure and lifecycle reporting.
Optionaloptions: TerminalConnectionOptionsIncoming chunks are parsed sequentially with BrowserTerminal.writeAsync. Terminal input is written to the transport without text conversion.
Releases workers, renderers, transports, addons, listeners, loaded fonts, and DOM resources.
Recalculates grid geometry from the container, including when initial grid options were set.
Focuses the terminal input element.
Reads the current selection as plain text.
Activates an addon and transfers disposal ownership to the terminal.
Loads a font face in every rendering context used by the terminal.
Subscribes to a typed browser terminal event.
Mounts a terminal created without a container.
Sends text through bracketed-paste handling when enabled.
Reads a clamped page of retained buffer rows; defaults to the visible viewport.
Optionalrange: TerminalBufferRangeReads a complete visible viewport snapshot.
Resets terminal state to its initial values.
Sets an explicit character-grid size.
Restores terminal state from compatible snapshot bytes.
Scrolls the viewport by a signed row delta.
Scrolls to the end of the buffer.
Scrolls to the beginning of the buffer.
Selects all terminal buffer content.
Sends text input toward the PTY.
Changes the browser accessibility mirror level.
Changes Ghostty's default cursor shape and blink behavior.
Applies font options and returns the resulting geometry.
Changes the renderer's minimum contrast ratio.
Changes the maximum retained scrollback lines.
Replaces the terminal theme and resolves after the resulting frame is rendered.
Serializes terminal state into Ghostty snapshot bytes.
Patches the current theme and resolves after the resulting frame is rendered.
High-level browser terminal API.
Remarks
A terminal owns its DOM, worker or main-thread backend, renderer, loaded fonts, addons, active transports, and event listeners. Release them together with BrowserTerminal.dispose.