This is the FloeTerm-maintained fork of Coder's ghostty-web. It publishes only
@floegence/ghostty-web and adds a versioned, validated logical checkpoint API
for durable terminal reconstruction.
Ghostty for the web with xterm.js API compatibility — giving you a proper VT100 implementation in the browser.
- Migrate from xterm by changing your import:
@xterm/xterm→@floegence/ghostty-web - WASM-compiled parser from Ghostty—the same code that runs the native app
- Zero runtime dependencies, ~400KB WASM bundle
Originally created for Mux (a desktop app for isolated, parallel agentic development), but designed to be used anywhere.
xterm.js is everywhere—VS Code, Hyper, countless web terminals. But it has fundamental issues:
| Issue | xterm.js | ghostty-web |
|---|---|---|
| Complex scripts (Devanagari, Arabic) | Rendering issues | ✓ Proper grapheme handling |
| XTPUSHSGR/XTPOPSGR | Not supported | ✓ Full support |
xterm.js reimplements terminal emulation in JavaScript. Every escape sequence, every edge case, every Unicode quirk—all hand-coded. Ghostty's emulator is the same battle-tested code that runs the native Ghostty app.
npm install @floegence/ghostty-web@floegence/ghostty-web aims to be API-compatible with the xterm.js API.
import { init, Terminal } from '@floegence/ghostty-web';
await init();
const term = new Terminal({
fontSize: 14,
theme: {
background: '#1a1b26',
foreground: '#a9b1d6',
},
});
term.open(document.getElementById('terminal'));
term.onData((data) => websocket.send(data));
websocket.onmessage = (e) => term.write(e.data);For a comprehensive client <-> server example, refer to the demo.
This fork builds from pinned Ghostty commit
5714ed07a1012573261b7b7e3ed2add9c1504496 with
patches/ghostty-wasm-api.patch. The patch
owns the C/WASM terminal and checkpoint ABI; TypeScript never serializes raw
WASM memory or implements a second VT parser.
Requires Zig and Bun.
bun run buildThe original Coder project and Ghostty remain credited under their MIT licenses in THIRD_PARTY_NOTICES.md.
