NousResearch/wterm
forked from vercel-labs/wterm
Captured source
source ↗NousResearch/wterm
Description: A terminal emulator for the web
License: Apache-2.0
Stars: 4
Forks: 1
Open issues: 0
Created: 2026-04-20T20:12:38Z
Pushed: 2026-04-19T18:45:49Z
Default branch: main
Fork: yes
Parent repository: vercel-labs/wterm
Archived: no
README:
wterm
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.
Packages
| Package | Description | |---|---| | [@wterm/core](packages/@wterm/core) | Headless WASM bridge + WebSocket transport | | [@wterm/dom](packages/@wterm/dom) | DOM renderer, input handler — vanilla JS terminal | | [@wterm/react](packages/@wterm/react) | React component + useTerminal hook (TypeScript) | | [@wterm/just-bash](packages/@wterm/just-bash) | In-browser Bash shell powered by just-bash | | [@wterm/markdown](packages/@wterm/markdown) | Render Markdown in the terminal |
Features
- 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
Development
Prerequisites
Setup
pnpm install
Build the WASM binary
zig build
For a release build:
zig build -Doptimize=ReleaseSmall
Build all packages
pnpm build
Run the vanilla demo
Serve the web/ directory with any static file server:
cd web && python3 -m http.server 8000
Run the Next.js example
All 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 dev
Run Zig tests
zig build test
License
Apache-2.0
Notability
notability 1.0/10Low star count fork