ghostty-webgpu

Ghostty's unpatched libghostty-vt core compiled to WebAssembly. WebGPU, WebGL2, Canvas 2D, and DOM renderers with per-cell damage tracking.

npm install ghostty-webgpu

Per-cell damage

A Zig frame builder tracks dirty rows and uploads only changed byte ranges. An idle screen submits zero GPU work.

Four renderers

First paint lands on Canvas 2D while WebGPU or WebGL2 warms up, then swaps in place. Falls back to Canvas or DOM.

Worker execution

Import ghostty-webgpu/worker to run libghostty-vt, frame building, and GPU rendering on OffscreenCanvas.


measured

In the November 2026 five-way suite (17 workloads at 1 and 16 terminals against xterm.js 6.0.0, ghostty-web 0.4.0, Wraith 0.6.1, and Restty 0.3.0), ghostty-webgpu uses a median 0.71x whole-browser CPU on Linux and 0.77x on M1 Mac relative to the best competitor in each cell. Main-entry cold download is 269.2 KiB brotli.

Linux PC CPU (34 cells)
26 wins, 5 even, 3 losses (median 0.71x)
M1 Mac CPU (34 cells)
24 wins, 9 even, 1 loss (median 0.77x)
Download (main, auto)
269.2 KiB brotli, 80 ms PC / 101 ms Mac cold paint

The interactive charts below show the paired Mac M1 CPU-energy ratios (ghostty-webgpu ÷ xterm.js, same renderer class, below 1.00 uses less energy). Ties and losses stay on the chart.

CPU energy, WebGL against xterm.js WebGL · Reviewed one-build standing, ghostty-webgpu 0.3.21. Qualified with limits; two balanced pairs per workload.

17 terminals, 40x12 cells each, device pixel ratio 2, 120 warm-up ticks then 900 measured ticks paced at 60 Hz, two balanced pairs per workload. CPU energy: macOS kernel per-process CPU energy estimate for all Chrome processes; excludes GPU-device, display and whole-system power. Apple M1 MacBook, AC power, load-guarded, headed Google Chrome 154.0.8037.93, hardware GPU (Metal). Run 2026-10-09 UTC; reviewed 2026-10-10. xterm.js WebGL addon 0.19.0, with Unicode 11 addon 0.9.0 on one Unicode line per tick.

CPU energy, WebGL against xterm.js WebGL: CPU energy, ghostty-webgpu ÷ xterm.js
Heavy log output 0.61
Heavy Unicode output 0.61
One Unicode line per tick 0.99
One ASCII line per tick 0.95
Typing-like edits 0.91

correct because it is ghostty

Escape parsing, modes, wrapping, reflow, selection text, and Unicode widths come straight from upstream libghostty-vt 7b11f3d, built unpatched with Zig 0.16.0. The browser host, Zig frame builder, and four renderers sit on top of that single native state.

169 cases in headless Chromium: 132 esctest2 methods plus 37 Unicode, grapheme, and byte-delivery cases. Both ghostty-webgpu failures match native Ghostty 1.3.1. Every case and failure.

Shipped: DEC mode 2026 synchronized output, mode 2027 grapheme clustering, opt-in GSUB ligatures, lazy BiDi, OSC 8 links. Not built yet: Sixel/Kitty graphics and retained-buffer search.

  • ghostty-webgpu 0.3.20: 167 of 169
  • xterm.js 6.0.0: 126 of 169
  • ghostty-web 0.4.0: 161 of 169

coming from xterm.js

Creation and opening are async, fitting runs automatically during open(), and PTY traffic stays as Uint8Array bytes end to end. Read the migration guide.

new Terminal(opts)
await Terminal.create(opts)
term.onData(str => send(str))
term.onData(({ bytes }) => send(bytes))
term.open(host)
await term.open(host)
term.resize(cols, rows)
term.setAppearance({ grid })
@xterm/headless
await GhosttyRuntime.create()

docs


roadmap