랭킹으로 돌아가기

coder/ghostty-web

TypeScript

Ghostty for the web with xterm.js API compatibility

browserghosttylibraryterminal
스타 성장
스타
2.6k
포크
149
주간 성장
이슈
25
1k2k
25년 11월26년 1월26년 4월26년 7월
아티팩트npmnpm install ghostty-web
README

ghostty-web

NPM Version NPM Downloads npm bundle size license

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/xtermghostty-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.

Try It

  • Live Demo on an ephemeral VM (thank you to Greg from disco.cloud for hosting).

  • On your computer:

    npx @ghostty-web/demo@next
    

    This starts a loopback-only HTTP server with a real shell on http://127.0.0.1:8080. The demo protects /ws with a per-run same-origin token and rejects cross-origin WebSocket handshakes. Works best on Linux and macOS.

    To intentionally bind somewhere else, set HOST=<host>. If you serve the demo through extra hostnames or a wildcard bind such as HOST=0.0.0.0, also set GHOSTTY_ALLOWED_HOSTS=host1,host2. Avoid remote exposure unless you understand the risk: the demo starts a real local shell.

ghostty

Comparison with xterm.js

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.

Installation

npm install ghostty-web

Usage

ghostty-web aims to be API-compatible with the xterm.js API.

import { init, Terminal } from '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.

Development

ghostty-web builds from Ghostty's source with a patch to expose additional functionality.

Requires Zig and Bun.

bun run build

Mitchell Hashimoto (author of Ghostty) has been working on libghostty which makes this all possible. The patches are very minimal thanks to the work the Ghostty team has done, and we expect them to get smaller.

This library will eventually consume a native Ghostty WASM distribution once available, and will continue to provide an xterm.js compatible API.

At Coder we're big fans of Ghostty, so kudos to that team for all the amazing work.

License

MIT

관련 저장소
vercel/next.js

The React Framework

JavaScriptnpmMIT Licensereactserver-rendering
nextjs.org
141.1k31.5k
LadybirdBrowser/ladybird

Truly independent web browser

C++BSD 2-Clause "Simplified" Licensebrowserbrowser-engine
ladybird.org
64.6k3.1k
withastro/astro

The web framework for content-driven websites. ⭐️ Star to support our work!

TypeScriptnpmOtherstatic-site-generatorblog
astro.build
61.2k3.6k
ChromeDevTools/chrome-devtools-mcp

Chrome DevTools for coding agents

TypeScriptnpmApache License 2.0mcp-serverpuppeteer
npmjs.org/package/chrome-devtools-mcp
47.4k3.2k
microsoft/monaco-editor

A browser based code editor

JavaScriptnpmMIT Licensemonaco-editorvscode
microsoft.github.io/monaco-editor/
46.4k4.1k
servo/servo

Servo aims to empower developers with a lightweight, high-performance alternative for embedding web technologies in applications.

Rustcrates.ioMozilla Public License 2.0servorust
servo.org
37.5k3.7k
SerenityOS/serenity

The Serenity Operating System 🐞

C++BSD 2-Clause "Simplified" Licenseoperating-systemc-plus-plus
serenityos.org
33.7k3.4k
lightpanda-io/browser

Lightpanda: the headless browser designed for AI and automation

ZigGNU Affero General Public License v3.0browsercdp
lightpanda.io
32.1k1.4k
ianstormtaylor/slate

A completely customizable framework for building rich text editors. (Currently in beta.)

TypeScriptnpmMIT Licenseeditorbrowser
slatejs.org
31.7k3.3k
webtorrent/webtorrent

⚡️ Streaming torrent client for the web

JavaScriptnpmMIT Licensewebtorrentbittorrent
webtorrent.io
31.3k2.9k
AvaloniaUI/Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The future of .NET UI

C#MIT Licensec-sharpxaml
avaloniaui.net
31.2k2.8k
fingerprintjs/fingerprintjs

The most advanced free and open-source browser fingerprinting library

TypeScriptnpmMIT Licensejavascriptdetection
fingerprint.com/github/
27.9k2.6k