LmCast :: Stay tuned in

Ghostty compiled to WASM with xterm.js API compatibility

Recorded: Dec. 2, 2025, 3:04 a.m.

Original Summarized

GitHub - coder/ghostty-web: Ghostty for the web with xterm.js API compatibility

Skip to content

Navigation Menu

Toggle navigation

Sign in

Appearance settings

PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback


We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

coder

/

ghostty-web

Public

Notifications
You must be signed in to change notification settings

Fork
22

Star
992

Ghostty for the web with xterm.js API compatibility

License

MIT license

992
stars

22
forks

Branches

Tags

Activity

Star

Notifications
You must be signed in to change notification settings

Code

Issues
2

Pull requests
3

Actions

Projects
0

Security

Uh oh!

There was an error while loading. Please reload this page.


Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Security

Insights

coder/ghostty-web

 mainBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History86 Commits.github.github  demodemo  ghostty @ 0f64b9aghostty @ 0f64b9a  liblib  patchespatches  scriptsscripts  .gitignore.gitignore  .gitmodules.gitmodules  .npmignore.npmignore  .prettierignore.prettierignore  .prettierrc.prettierrc  AGENTS.mdAGENTS.md  LICENSELICENSE  README.mdREADME.md  biome.jsonbiome.json  bun.lockbun.lock  bunfig.tomlbunfig.toml  happydom.tshappydom.ts  package.jsonpackage.json  tsconfig.jsontsconfig.json  vite.config.jsvite.config.js  View all filesRepository files navigationREADMECode of conductMIT licenseSecurityghostty-web

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/xterm → ghostty-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 local HTTP server with a real shell on http://localhost:8080. Works best on Linux and macOS.

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

About

Ghostty for the web with xterm.js API compatibility

Topics

library

browser

terminal

ghostty

Resources

Readme

License

MIT license

Code of conduct

Code of conduct

Security policy

Security policy

Uh oh!

There was an error while loading. Please reload this page.


Activity

Custom properties
Stars

992
stars
Watchers

0
watching
Forks

22
forks

Report repository

Releases

5
tags

Uh oh!

There was an error while loading. Please reload this page.


Contributors
5

Uh oh!

There was an error while loading. Please reload this page.


Languages

TypeScript
99.4%

Other
0.6%

Footer

© 2025 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

Ghostty for the web represents a focused effort to provide a terminal emulation experience directly within a web browser, leveraging the existing xterm.js API compatibility as a core design principle. The project, developed by Coder, is built upon the established Ghostty native application codebase, utilizing a WASM (WebAssembly) compiled parser for efficiency. This approach addresses several limitations observed within the prevalent xterm.js library, particularly concerning complex script handling, grapheme support, and overall terminal emulation accuracy.

The project’s architecture centers around a minimal set of patches applied to Ghostty’s source code, significantly reducing the codebase’s size. These modifications expose additional functionality, facilitating direct integration within a web environment. The foundational work is spearheaded by Mitchell Hashimoto, the creator of Ghostty, alongside the continued efforts of the Ghostty team. The project’s target is a future native Ghostty WASM distribution, ensuring a streamlined experience by utilizing the same battle-tested code already proven successful in the native application.

A key differentiator is the project's commitment to xterm.js API compatibility. Developers can seamlessly transition by simply changing their import statement from `@xterm/xterm` to `ghostty-web`, simplifying the adoption process. The implementation relies on a Bun-based build system alongside Zig, ensuring consistent and manageable development. The project incorporates a comprehensive client-server example, which could provide valuable insights into its functionality and integration.

The project’s value stems from several factors: its direct reliance on the well-established Ghostty codebase, its dedication to xterm.js API compatibility, and its utilization of WASM for optimized performance. This approach uniquely positions Ghostty for the web as a viable alternative or complement to xterm.js, particularly in scenarios requiring precise terminal emulation and robust script handling. The project’s success hinges on continued development and refinement by the Ghostty team, with the goal of eventually consuming a native Ghostty WASM distribution. This ultimately benefits the developer community by offering a reliable and compatible terminal experience directly within the web browser environment.