Skip to content

Coming from xterm.js

Creation is asynchronous, input events carry bytes, and the main entry writes synchronously. Begin with the quick start, then replace your transport and appearance wiring.

This table imports a checked registry. Every instance member below must exist on the built Terminal declaration.

xterm.jsghostty-webgpuBehavior
new Terminal(options)await Terminal.create(options)Creation loads wasm asynchronously.
open(host)openAwait opening; the host must have a size.
write(data, callback)writeSynchronous result on the main entry; promise in the worker.
writeln(data)writelnWrite a line through native parsing.
onData / onBinaryonDataThe listener receives Uint8Array bytes.
onResizeonResizeThe event has cols and rows.
onTitleChange / onBellonSubscribe to title and bell events.
onRenderonFrameObserve submitted rows.
FitAddon.fit()setAppearanceAutomatic fit; set appearance.grid for explicit geometry.
options.themesetThemeRGB objects and a 256-entry palette.
options.fontFamily / fontSizesetFontA partial native font object.
options.cursorStyle / cursorBlinksetCursorA partial native cursor object.
buffer.active.lengthlineCountCounts retained history and active visible rows.
buffer.getLine(i)readLinesHalf-open ranges, capped at 1,024 rows.
getSelection()getSelectionChoose plain, VT or HTML formatting.
select / selectAllselectRangeNative coordinates; selectAll is also available.
scrollLinesscrollByScroll by a row delta.
scrollToLinescrollToRowScroll to a retained row.
loadAddon(addon)useInstall a native extension.
registerLinkProviderregisterLinkProviderURL and OSC 8 detection are built in.
attachCustomKeyEventHandlerconnectInputSynchronous claim/pass ownership on the main entry.
focus / blur / disposedisposeFocus and blur stay synchronous; dispose returns a promise in the worker.

Use sendInput for generated input, paste for bracketed paste and key for a synthesized key. Named events include title, bell, selection and scroll. The generated reference has their payload types.

xterm.js addonCurrent integrationStatus
FitThe host fits automaticallyBuilt in
WebGLAutomatic WebGL2/WebGPU selectionBuilt in
Unicode 11 / Unicode graphemesNative widths and mode 2027Built in
Web linksURL detection, OSC 8 and link providersBuilt in on main entry
ClipboardHost clipboardWrite policy for OSC 52 writes; defaults to denyWrite-only policy
AttachWebSocket recipeGuide
Web fontsLoad browser or worker facesGuide
SerializeHistory reads, selection formats and visual viewport capturePartial; full emulator serialization is planned
SearchRetained-cell searchPlanned
ImageImage protocolsPlanned
LigaturesRun shapingPlanned
ProgressNative progress events exposed to the hostPlanned

The extension plan tracks the extension model. The terminal roadmap tracks delivery. Worker link providers and keyboard link discovery currently report capability errors.

registerMarker, registerDecoration and the general xterm parser-handler API have no public equivalent today. Custom OSC observation is a session-level capability. Clipboard reads through OSC 52 receive no reply.

Use appearance.scrollbackLimit and appearance.scrollbackByteLimit. Retention is page-granular. Read lineCount() for the actual retained count. Colors use RGB values, and minimumContrast belongs to the theme. Load the font before opening so the grid uses its measured geometry.

The benchmark report records the environments, methods, renderer-specific results and losses. Compare WebGL with WebGL and DOM with DOM. Input latency, Unicode output and scrolling are separate workloads.

Connect your PTY, apply a theme and check the worker boundaries before moving your host off the main thread.