[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73860":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},73860,"ghostty-web","coder\u002Fghostty-web","coder","Ghostty for the web with xterm.js API compatibility","",null,"TypeScript",2535,134,5,27,0,11,30,112,33,103.39,"MIT License",false,"main",true,[27,28,29,30],"browser","ghostty","library","terminal","2026-06-12 04:01:12","# ghostty-web\n\n[![NPM Version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fghostty-web)](https:\u002F\u002Fnpmjs.com\u002Fpackage\u002Fghostty-web) [![NPM Downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdw\u002Fghostty-web)](https:\u002F\u002Fnpmjs.com\u002Fpackage\u002Fghostty-web) [![npm bundle size](https:\u002F\u002Fimg.shields.io\u002Fbundlephobia\u002Fminzip\u002Fghostty-web)](https:\u002F\u002Fnpmjs.com\u002Fpackage\u002Fghostty-web) [![license](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fcoder\u002Fghostty-web)](.\u002FLICENSE)\n\n[Ghostty](https:\u002F\u002Fgithub.com\u002Fghostty-org\u002Fghostty) for the web with [xterm.js](https:\u002F\u002Fgithub.com\u002Fxtermjs\u002Fxterm.js) API compatibility — giving you a proper VT100 implementation in the browser.\n\n- Migrate from xterm by changing your import: `@xterm\u002Fxterm` → `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:\u002F\u002Fgithub.com\u002Fcoder\u002Fmux) (a desktop app for isolated, parallel agentic development), but designed to be used anywhere.\n\n## Try It\n\n- [Live Demo](https:\u002F\u002Fghostty.ondis.co) on an ephemeral VM (thank you to Greg from [disco.cloud](https:\u002F\u002Fdisco.cloud) for hosting).\n\n- On your computer:\n\n  ```bash\n  npx @ghostty-web\u002Fdemo@next\n  ```\n\n  This starts a local HTTP server with a real shell on `http:\u002F\u002Flocalhost:8080`. Works best on Linux and macOS.\n\n![ghostty](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Faceee7eb-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\u002FXTPOPSGR**                   | [Not supported](https:\u002F\u002Fgithub.com\u002Fxtermjs\u002Fxterm.js\u002Fissues\u002F2570) | ✓ 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) => websocket.send(data));\nwebsocket.onmessage = (e) => term.write(e.data);\n```\n\nFor a comprehensive client \u003C-> server example, refer to the [demo](.\u002Fdemo\u002Findex.html#L141).\n\n## Development\n\nghostty-web builds from Ghostty's source with a [patch](.\u002Fpatches\u002Fghostty-wasm-api.patch) to expose additional\nfunctionality.\n\n> Requires Zig and Bun.\n\n```bash\nbun run build\n```\n\nMitchell Hashimoto (author of Ghostty) has [been working](https:\u002F\u002Fmitchellh.com\u002Fwriting\u002Flibghostty-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](.\u002FLICENSE)\n","ghostty-web 是一个为 Web 环境设计的终端模拟器，兼容 xterm.js API。它使用 TypeScript 编写，并通过 WASM 技术编译 Ghostty 的解析器来实现 VT100 终端协议的支持，确保了复杂脚本（如 Devanagari 和阿拉伯语）和 XTPUSHSGR\u002FXTPOPSGR 指令的正确处理。项目具有零运行时依赖特性，WASM 包大小约为 400KB，易于集成到现有基于 xterm.js 的项目中。适合需要在浏览器环境中提供高性能、高兼容性终端体验的应用场景，比如在线开发环境、远程服务器管理界面等。",2,"2026-06-11 03:47:41","high_star"]