Ghostty compiled to WASM with xterm.js API compatibility

github.com

381 points by kylecarbs a day ago


mitchellh - a day ago

Holy shit Kyle. I had no idea you were working on this. This is amazing. Your patch is also very instructive on what you need me to do for you to make this more reasonable.

I'm guessing that performance of this relative to xterm right now isn't... the best, mainly because the way you're grabbing the viewport seems expensive. I'm curious though if you did any benchmarks?

One thing you probably really want to expose is the new RenderState API: https://github.com/ghostty-org/ghostty/blob/main/src/termina... You're doing per row line grabbing currently which is probably pretty slow. The RenderState API is stateful and produces the state necessary to create a high-performance, delta update renderer. It's what our production GPU renderers are now built on (but the API itself is compatible with any kind of renderer). It'd be better for you.

After all that, I'm very curious even at this rudimentary level what the performance on various benchmarks look like compared to xterm.js.

Excellent work!

emadda - 14 hours ago

I built a macOS app that uses Ghostty and fzy to fuzzy search over Apple Note titles. It is working quite well for me.

https://github.com/emadda/hot-notes/

clintonc - a day ago

Curious to know what makes this "a proper VT100 implementation in the browser, not a JavaScript approximation of one" -- isn't Ghostty also an approximation, just implemented in a different language? Seems unnecessarily pejorative to me.

syrusakbary - a day ago

I've set up an online demo using Wasmer for local execution, so everyone can try easily! (try typing `cowsay hello`):

https://ghostty-web.wasmer.app/

How to try it locally:

  npx @ghostty-web/demo@next # The preferred way
  # OR 
  wasmer run wasmer/ghostty-web

  -> Go to http://localhost:8080/
Source code: https://github.com/wasmerio/webassembly.sh (updated from xterm into ghostty-web without any issue!)
jxdxbx - a day ago

Ghostty is so great. Cross-platform but native on Mac and Linux. Core written in a cool random language, showing that you can have well-behaved Mac apps that aren’t just pure Swift / Objective C. Same great design no doubt helps here.

nineteen999 - 20 hours ago

Always love seeing new vt100 implementations! Here's my current pet one running inside Unreal5:

  https://imgur.com/a/2vsGS0G
Vibe coding with Claude in a UE5 Editor tab is a lot of fun ... especially once you give it access to the Remote Control API in UE5, it can control an avatar, take screenshots. All very helpful for debugging 3d games:

  ### Photo Log

  | Filename | Description |
  |----------|-------------|
  | ClaudePOV_20251202_134349_2.png | First 720p test - VT100 terminal visible |
  | ClaudePOV_20251202_143259_4.png | Inside hyperspace tunnel - green rings |
  | ClaudePOV_20251202_143325_5.png | Tunnel with pink/purple shift |
  | ClaudePOV_20251202_143432_6.png | BX-2100 silhouette, purple nebula |
  | ClaudePOV_20251202_143655_7.png | BX-2100 close-up, cockpit visible |
Love Claude. It can build me a Hyperspace GLSL shader in Unreal 5, but it can't get the column headers right in it's screenshot list.
someguy101010 - a day ago

nice one kyle! you could add https://github.com/wasmerio/webassembly.sh and have a fully featured in browser shell with support for installing packages!

VikingCoder - a day ago

So, could someone now make a Visual Studio Code (and specifically code-server) that has ghostty-web as the Terminal?

xmorse - 13 hours ago

I made something similar that lets you run TUI applications inside other terminals via ghostty-vt, to implement things like TMUX in opentui

It will be used to render ANSI inside opencode

https://github.com/remorses/ghostty-opentui

tuananh - a day ago

I'm just here to say coder is great! We love it. Thanks @kylecarbs and the team.

thoughtfulchris - a day ago

This is super cool! I'm close to releasing a project to make Ink work in the browser for building cross-platform terminal apps. (Ink is what Claude Code / Gemeni CLI use for rendering.)

Currently it uses Xterm.js - but I'll have to try swapping Xterm out for ghostty-web!

royaltjames - 9 hours ago

I love ghostty and I love this

gregsadetsky - a day ago

Hey all, you can try ghostty-web here:

https://ghostty.ondis.co/

Stellar work, Kyle! Cheers

jordemort - a day ago

Hm, might try hacking this into https://tsl0922.github.io/ttyd/

warunsl - a day ago

I have no understanding of any of this except that Ghostty is an alternative to iTerm2. Can someone do a ELI5 for the uninitiated?

jumploops - a day ago

Oh man this is awesome. Recently integrated xterm.js on a new project and was frustrated with the limitations. Great work!

indemnity - a day ago

Oh damn, this is awesome.

I wonder if https://github.com/zed-industries/zed/discussions/18129 is still accurate. Would love to be able to use Ghostty as my Zed terminal.

solotronics - a day ago

I always thought it would be interesting in backend systems to catch a certain exceptions and auto-generate a link to a shell. Given the proper authentication is implemented would this be a good tool to achieve that "remote debug" shell?

joshka - a day ago

Neat. Would be cute to see this in VSCode to replace the terminal there...

asadm - a day ago

can you do a hosted demo with jslinux (or similar) as backend? https://bellard.org/jslinux/

aidenyb - a day ago

This is great. I've been using code-server to embed VSCode into the browser and been missing the terminal functionality. Excited to try this out.

quantummagic - a day ago

Is there any way for Ghostty to grab all keystrokes? It's a bit of a drag to type ctrl-w inside of Vim, and have the entire browser-tab close ;-)

neomantra - a day ago

I have been looking for this for a while — thank you for making it! I’m gonna explore how I can deploy my BubbleTea TUI’s with it.

oersted - a day ago

Does this version support custom GPU shaders? I have been looking for a command-line with cool-retro-term aesthetics that can run in the browser for a while.

vadepaysa - a day ago

This is fantastic. Under MIT even! Thank You!

riddley - a day ago

Someone finally figured out how to make it work under Linux!

pmarreck - a day ago

omg! Seriously, wow. That was quick! Only just heard that Hashimoto libbed out his terminal the other day and remarked about how smart that was... And it made this possible

shortlived - a day ago

Do we have Windows support yet?

westurner - 20 hours ago

Not able to enter text on mobile

From "WebAssembly (WASM) arch support for the Linux kernel" (2025) https://news.ycombinator.com/item?id=45784329 :

> JupyterLite still lacks a Terminal e.g. with BusyBox Ash in WASM, with a file system integrated with the Jupyter-xeus kernel file system.

> This [joelseverin/linux-wasm] appears to load much more quickly than other Linux and I think even just bash in WASM demos I've seen.

ivanjermakov - a day ago

No hosted demo?

- 18 hours ago
[deleted]
sigmonsays - a day ago

but why?

- a day ago
[deleted]