Creates a terminal using xterm.js initialization and runtime options.
Readonlybufferxterm-compatible normal, alternate, and active buffer views.
ReadonlynativeResolves to the underlying native Gespenst terminal.
ReadonlyonFires when the terminal processes a bell control character.
ReadonlyonFires for binary input emitted by the compatibility layer.
ReadonlyonFires when the active buffer cursor moves.
ReadonlyonFires when user input should be forwarded to the PTY.
ReadonlyonFires with both encoded input and the originating browser key event.
ReadonlyonFires when parsed output advances to a new line.
ReadonlyonFires when an inclusive viewport row range needs rendering.
ReadonlyonFires when terminal character geometry changes.
ReadonlyonFires with the current viewport scroll position.
ReadonlyonFires when the current text selection changes.
ReadonlyonFires when a VT title sequence changes the terminal title.
ReadonlyonFires after a queued write has been parsed and synchronized.
Readonlyparserxterm-compatible parser registration API applied before bytes reach Ghostty.
ReadonlyreadyResolves after the Ghostty WASM runtime is initialized and native listeners are installed.
ReadonlyunicodeUnicode-width provider namespace; Ghostty remains the authoritative width engine.
StaticstringsLocalizable strings used by accessibility helpers.
Current number of terminal columns.
The root xterm-compatible element after open has been called.
Registered markers in the normal buffer. Requires the proposed API option.
Current terminal mode flags mirrored from parsed VT control sequences.
Mutable xterm.js runtime options proxy.
Current number of terminal rows.
The native terminal's input textarea after asynchronous startup.
Installs a keyboard event filter invoked before the native input handler.
Installs a wheel event filter invoked before native scrolling.
Removes keyboard focus from the terminal input element.
Clears scrollback and moves the current cursor row to the top, matching xterm.js.
Clears the current selection.
Invalidates the full visible render range.
Disposes addons, events, markers, decorations, DOM, and the native terminal.
Moves keyboard focus to the terminal input element.
Returns the selected text.
Returns the selected xterm buffer range, when a selection exists.
Returns whether the terminal currently has a non-empty selection.
Sends user input to the PTY-facing native input stream.
Activates an xterm.js addon and owns it until terminal disposal.
Mounts the terminal in parent; repeated calls after a successful open are no-ops.
Sends pasted text through Ghostty's paste input path.
Emits an xterm-compatible render event for the inclusive row range.
Registers a DOM decoration for a marker. Requires the proposed API option.
Registers an xterm.js link provider and returns a disposable registration.
Registers a marker relative to the current cursor row.
Resets VT state, sidecar modes, and buffer tracking.
Resizes the terminal to the requested character geometry.
Scrolls the viewport by a signed row count.
Scrolls the viewport by a signed page count.
Scrolls to the end of the buffer.
Scrolls to an absolute zero-based buffer row.
Scrolls to the beginning of the buffer.
Selects length characters from a zero-based buffer coordinate.
Selects all available buffer content.
Selects a contiguous range of zero-based buffer rows.
Queues text or bytes for Ghostty parsing and invokes callback after synchronization.
Optionalcallback: () => voidWrites text or bytes followed by carriage return and line feed.
Optionalcallback: () => void
The stable xterm.js 6 public API backed by Ghostty's VT implementation. Use
readywhenever work must wait for the asynchronous WASM startup.