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 Include my email address so I can be contacted Cancel Submit feedback Saved searches
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. Dismiss alert coder ghostty-web Public
Notifications
Fork
Star Ghostty for the web with xterm.js API compatibility MIT license 992 22 Branches Tags Activity
Star
Notifications Code Issues Pull requests Actions Projects 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 Migrate from xterm by changing your import: @xterm/xterm → ghostty-web Originally created for Mux (a desktop app for isolated, parallel agentic development), but designed to be used anywhere. Live Demo on an ephemeral VM (thank you to Greg from disco.cloud for hosting). On your computer: Comparison with xterm.js Issue Complex scripts (Devanagari, Arabic) XTPUSHSGR/XTPOPSGR 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. await init(); const term = new Terminal({ term.open(document.getElementById('terminal')); Requires Zig and Bun. bun run build About Ghostty for the web with xterm.js API compatibility library browser terminal ghostty Resources Readme 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 992 0 22 Report repository Releases 5 Uh oh! There was an error while loading. Please reload this page. Contributors Uh oh! There was an error while loading. Please reload this page. Languages TypeScript Other 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. |