ReadonlyelementRoot DOM element owned by the terminal.
ReadonlyrendererActive renderer and shaping implementation.
Current character-grid and backing-surface geometry.
Current authored theme. Missing values inherit from DEFAULT_THEME.
Removes focus from the hidden terminal input.
Clears the active text selection.
Connects terminal output and input to bidirectional PTY byte streams.
Incoming chunks are awaited through GespenstTerminal.writeAsync. Outgoing input is
copied into a bounded queue whose default limit is 1 MiB. Geometry is intentionally separate;
subscribe to resize and forward columns and rows through the backend's control protocol.
Releases transports, addons, fonts, workers, renderers, events, and DOM resources.
Recalculates terminal geometry from its current container, ignoring fixed initial grid values.
Focuses the hidden terminal input.
Reads selected text.
Activates an addon and owns it until terminal disposal.
Loads a font face in the document and active rendering backend.
Loading a face does not select it. Follow with GespenstTerminal.setFont when the terminal should use the new family.
Subscribes to a typed browser terminal event.
Mounts a terminal created without a container and recalculates its layout.
Sends text through bracketed-paste handling when enabled.
Delivers a user-authorized browser clipboard snapshot to Ghostty.
Reads retained active-buffer rows without reparsing terminal output.
Optionalrange: TerminalBufferRangeReads a complete visible viewport snapshot.
Resets terminal state to initial values.
Fits to the container or applies an explicit character-grid size.
Optionalcols: numberOptionalrows: numberCalling without both dimensions respects fixed cols and rows creation options.
Use GespenstTerminal.fit to force container measurement.
Restores terminal state from compatible snapshot bytes.
Scrolls the viewport by a signed row count.
Scrolls to the end of the buffer.
Scrolls to the beginning of the buffer.
Selects all terminal buffer content.
Sends composed text toward the PTY.
Changes the browser accessibility mirror level.
Changes Ghostty's default cursor shape and blink behavior.
Applies font values and returns recalculated terminal geometry.
Changes the renderer's minimum contrast ratio.
Changes the maximum retained scrollback lines.
Serializes terminal state into Ghostty snapshot bytes.
Queues terminal output for VT parsing without waiting for the next rendered frame.
Parses and renders terminal output before resolving.
StaticcreateCreates and asynchronously initializes a browser terminal.
Browser terminal combining Ghostty VT state, worker isolation, rendering, DOM input, and PTY streams.
Remarks
Create terminals through createTerminal. The terminal owns every resource activated through it and releases those resources together through GespenstTerminal.dispose.
Example: Minimal browser terminal