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!
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!)I'm just here to say coder is great! We love it. Thanks @kylecarbs and the team.
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!
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.
So, could someone now make a Visual Studio Code (and specifically code-server) that has ghostty-web as the Terminal?
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.
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.
Hm, might try hacking this into https://tsl0922.github.io/ttyd/
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 ;-)
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!
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?
I have no understanding of any of this except that Ghostty is an alternative to iTerm2. Can someone do a ELI5 for the uninitiated?
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.
Neat. Would be cute to see this in VSCode to replace the terminal there...
can you do a hosted demo with jslinux (or similar) as backend? https://bellard.org/jslinux/
This is fantastic. Under MIT even! Thank You!
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.
Oh man this is awesome. Recently integrated xterm.js on a new project and was frustrated with the limitations. Great work!
Someone finally figured out how to make it work under Linux!
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
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.