A terminal emulator for the web.
wterm ("dub-term") renders to the DOM — native text selection, copy/paste, find, and accessibility come for free. The core is written in Zig and compiled to WASM for near-native performance.
| Package | Description |
|---|---|
@wterm/core |
Headless WASM bridge + WebSocket transport |
@wterm/dom |
DOM renderer, input handler — vanilla JS terminal |
@wterm/react |
React component + useTerminal hook (TypeScript) |
@wterm/just-bash |
In-browser Bash shell powered by just-bash |
@wterm/markdown |
Render Markdown in the terminal |
- Zig + WASM core — VT100/VT220/xterm escape sequence parser compiled to a ~12 KB
.wasmbinary (release build) - DOM rendering — native text selection, clipboard, browser find, and screen reader support
- Dirty-row tracking — only touched rows are re-rendered each frame via
requestAnimationFrame - Themes — CSS custom properties with built-in Default, Solarized Dark, Monokai, and Light themes
- Alternate screen buffer —
vim,less,htop, and similar apps work correctly - Scrollback history — configurable ring buffer
- 24-bit color — full RGB SGR support
- Auto-resize —
ResizeObserver-based terminal resizing - WebSocket transport — connect to a PTY backend with binary framing and reconnection
pnpm installzig buildFor a release build:
zig build -Doptimize=ReleaseSmallpnpm buildServe the web/ directory with any static file server:
cd web && python3 -m http.server 8000All dev servers use portless to avoid hardcoded ports. Each app is served at a .localhost URL (e.g. nextjs-example.wterm.localhost).
cp web/wterm.wasm examples/nextjs/public/
pnpm --filter nextjs devzig build testApache-2.0