{"id":38766990,"url":"https://github.com/coder/ghostty-web","last_synced_at":"2026-07-12T18:02:14.975Z","repository":{"id":324086732,"uuid":"1093708164","full_name":"coder/ghostty-web","owner":"coder","description":"Ghostty for the web with xterm.js API compatibility","archived":false,"fork":false,"pushed_at":"2026-06-26T16:19:21.000Z","size":3337,"stargazers_count":2560,"open_issues_count":57,"forks_count":139,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-06-26T16:23:13.576Z","etag":null,"topics":["browser","ghostty","library","terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-10T18:24:06.000Z","updated_at":"2026-06-26T12:48:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/coder/ghostty-web","commit_stats":null,"previous_names":["coder/ghostty-web"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/coder/ghostty-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fghostty-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fghostty-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fghostty-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fghostty-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder","download_url":"https://codeload.github.com/coder/ghostty-web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fghostty-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35398566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","ghostty","library","terminal"],"created_at":"2026-01-17T12:00:50.505Z","updated_at":"2026-07-12T18:02:14.969Z","avatar_url":"https://github.com/coder.png","language":"TypeScript","funding_links":[],"categories":["Web \u0026 Embedded Terminals","TypeScript"],"sub_categories":[],"readme":"# ghostty-web\n\n[![NPM Version](https://img.shields.io/npm/v/ghostty-web)](https://npmjs.com/package/ghostty-web) [![NPM Downloads](https://img.shields.io/npm/dw/ghostty-web)](https://npmjs.com/package/ghostty-web) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/ghostty-web)](https://npmjs.com/package/ghostty-web) [![license](https://img.shields.io/github/license/coder/ghostty-web)](./LICENSE)\n\n[Ghostty](https://github.com/ghostty-org/ghostty) for the web with [xterm.js](https://github.com/xtermjs/xterm.js) API compatibility — giving you a proper VT100 implementation in the browser.\n\n- Migrate from xterm by changing your import: `@xterm/xterm` → `ghostty-web`\n- WASM-compiled parser from Ghostty—the same code that runs the native app\n- Zero runtime dependencies, ~400KB WASM bundle\n\nOriginally created for [Mux](https://github.com/coder/mux) (a desktop app for isolated, parallel agentic development), but designed to be used anywhere.\n\n## Try It\n\n- [Live Demo](https://ghostty.ondis.co) on an ephemeral VM (thank you to Greg from [disco.cloud](https://disco.cloud) for hosting).\n\n- On your computer:\n\n  ```bash\n  npx @ghostty-web/demo@next\n  ```\n\n  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.\n\n  To intentionally bind somewhere else, set `HOST=\u003chost\u003e`. 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.\n\n![ghostty](https://github.com/user-attachments/assets/aceee7eb-d57b-4d89-ac3d-ee1885d0187a)\n\n## Comparison with xterm.js\n\nxterm.js is everywhere—VS Code, Hyper, countless web terminals. But it has fundamental issues:\n\n| Issue                                    | xterm.js                                                         | ghostty-web                |\n| ---------------------------------------- | ---------------------------------------------------------------- | -------------------------- |\n| **Complex scripts** (Devanagari, Arabic) | Rendering issues                                                 | ✓ Proper grapheme handling |\n| **XTPUSHSGR/XTPOPSGR**                   | [Not supported](https://github.com/xtermjs/xterm.js/issues/2570) | ✓ Full support             |\n\nxterm.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.\n\n## Installation\n\n```bash\nnpm install ghostty-web\n```\n\n## Usage\n\nghostty-web aims to be API-compatible with the xterm.js API.\n\n```javascript\nimport { init, Terminal } from 'ghostty-web';\n\nawait init();\n\nconst term = new Terminal({\n  fontSize: 14,\n  theme: {\n    background: '#1a1b26',\n    foreground: '#a9b1d6',\n  },\n});\n\nterm.open(document.getElementById('terminal'));\nterm.onData((data) =\u003e websocket.send(data));\nwebsocket.onmessage = (e) =\u003e term.write(e.data);\n```\n\nFor a comprehensive client \u003c-\u003e server example, refer to the [demo](./demo/index.html#L141).\n\n## Development\n\nghostty-web builds from Ghostty's source with a [patch](./patches/ghostty-wasm-api.patch) to expose additional\nfunctionality.\n\n\u003e Requires Zig and Bun.\n\n```bash\nbun run build\n```\n\nMitchell Hashimoto (author of Ghostty) has [been working](https://mitchellh.com/writing/libghostty-is-coming) 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.\n\nThis library will eventually consume a native Ghostty WASM distribution once available, and will continue to provide an xterm.js compatible API.\n\nAt Coder we're big fans of Ghostty, so kudos to that team for all the amazing work.\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder%2Fghostty-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder%2Fghostty-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder%2Fghostty-web/lists"}