Something went wrong. Try again.
Ghostty for the web with xterm.js API compatibility
Something went wrong. Try again.
HTML 60%
TypeScript 34%
Zig 5%
Shell 1%
README.md
WASM Terminal - xterm.js Compatible #
A minimal terminal emulator with an xterm.js-compatible API, built with:
- TypeScript for terminal state management and rendering
- Zig + WASM for low-level parsing helpers (optional)
- libghostty-vt inspiration (though current implementation is self-contained)
Status: Proof of Concept (PoC) #
This is a janky, experimental implementation to explore using libghostty-vt with WASM.
Structure #
wasm-terminal/
├── zig/ # Zig WASM module
│ ├── build.zig # Zig build configuration
│ ├── main.zig # WASM exports (helper functions)
│ └── zig-out/bin/ # Compiled WASM binary
├── src/
│ └── terminal.ts # TypeScript terminal implementation
├── index.html # Demo page
└── README.md
Building #
# Build WASM module (requires Zig 0.13.0)
cd zig
zig build
# Open demo
# Serve index.html with any HTTP server, e.g.:
python3 -m http.server 8000
# Then open http://localhost:8000
API Compatibility #
Implements core xterm.js Terminal API:
new Terminal(options)open(parent)write(data)resize(cols, rows)clear()dispose()onDataeventonResizeevent
Current Limitations #
- No ANSI color parsing yet (cell attributes exist, not implemented)
- No selection/clipboard support
- No addons support
- Basic rendering (no canvas/webgl)
- WASM module is minimal (just helper functions)
Next Steps #
To make this production-ready:
- Add full ANSI/VT escape sequence parsing
- Implement color rendering (SGR sequences)
- Add cursor rendering and styles
- Integrate actual libghostty-vt WASM builds
- Performance optimization
- Selection and clipboard support
- Scrollback buffer management
License #
See main cmux LICENSE (AGPL-3.0)