95 comments

[ 2.7 ms ] story [ 84.2 ms ] thread
Can I really render a 3D rat on my terminal? If I can then I'm sold.
I actually see some use cases for this. It's one of those should be nonsense projects that somehow isn't.
Rip Terry. May you never be forgotten.

edit: But your spirit lives on ( based on the project:D )

This looks a lot like it'd qualify for a ShowHN. Add "ShowHN: " to the beginning of the title and it should show up in /show
Seems... really good?!

Questions:

- rendering capabilities of this seem like it should also be able to handle 2d well, or am I mistaken? every solution I see for getting high quality 2d images or rasterization in terminal is all pretty bad. Could this do better than other solutions or is there a fundamental limit being hit somewhere?

- What happens with ssh given that this is gpu accelerated?

Imagine this with VR dev environments!
Really fun project! Dude, I spent the last week implementing Kitty Graphics and Clipboard protocols in ghostty-web in the Canvas render.

Then I added WebGL and WebGPU renderers [1], including support for Kitty.

Then I see this this project on a Monday morning... so now I have to implement Ratty Graphics Protocol?!?! [2].

ETA: I looked into this; Ghostty would need patched to support Ratty since Ghostty-Web now defers APC handling there. It would also require pulling in a 3D engine like three.js or otherwise implementing file parsing, lighting, etc. Finally, since local filenames are part of the protocol, a browser would need some file resolver helper, either to get the data over the APC channel or via a URL.

[1] https://github.com/NimbleMarkets/ghostty-web/tree/nm-webgpu

[2] https://github.com/orhun/ratty/blob/main/protocols/graphics....

Dude. Congrats. You actually made a compelling argument to put rust on my machine:P
IMO, next crazy step is for terminal to just have wayland or X11 protocol ? (/s or not?)
I have been thinking about this for a while. It's not as crazy as it may sound, especially in light of the other comments making a parallel between terminals and notebooks.

A few thoughts:

1. Linux VTs kind of have this feature already: there is the normal buffer, the alternate buffer (that something like htop would draw on), and an IOctl can change them to/from graphics mode.

2. It makes sense for interactivity. Kitty's graphics protocol is quite useful for static shapes, can be abused for animations, but doesn't really cut it for interactivity (say, pan a graph around). Wayland is designed for this.

3. Wayland would be a good fit: isolate each command from another, let them request buffers, but keep control of where to display them, do not update them when off screen, etc.

4. One downside is that terminals excel for one-shot tasks. What's the purpose of the display when you are done with it? Should you kill the process driving it? Due to this, it may make more sense to delegate more features to the terminal emulator (displaying the 3D model, etc). Or maybe just allow the app to temporarily take over the window.

5. Once you have it up and running, have it talk directly to the direct rendering manager. Your "kmscon" is now your compositor / desktop environment. That's a fun thought! Add some basic terminal features like tabs and tiling, and you've inverted the usual setup.

6. One downside is accessibility. I really like that I can copy-paste any part of the interface for reference, "screenshots", etc. It's good for screen readers, too. You lose these advantages by going to Wayland.

7. Another current terminal limitation is fonts. Power line, yazi & other make use of custom fonts for drawing part of the interface, logos, etc. AFAIK there is no good way to query their availability (which is also an issue for color emoji). Custom fonts or a new protocol could be useful, but client apps could draw it themselves if given a surface (that can already do that with the kitty graphics protocol, mind you)

Obviously I am not seriously considering to make such a terminal emulator, but it would be an interesting experiment (heck, maybe something I should try this "vibe coding" with, since I wouldn't want to spend too much time on it).

That is how terminals work in OSes that were born with framebuffers instead of teletypes.

It is just another graphical application window on the OS.

Terminal is slowly becoming a full featured web browser.
(comment deleted)
This is a great idea. I always wanted KDE konsole to e. g. show images inlined as is. This is possible via magick six:-, but I wanted this to be natively. I want the terminal to be able to work with any data and display it in any way. No need to simulate the 1980s era anymore (except for backwards/legacy support). So great idea here really.
Emojis in a terminal are a step too far for me. This is just... Indulgent.
I like this. No reason the terminal should only support text. Data science notebooks show one way the terminal can evolve. Lots of interesting stuff happening in this space, with Kitty probably being the most aggressive innovator here [1]. I'm not sure there is an overall vision, though.

[1]: https://sw.kovidgoyal.net/kitty/protocol-extensions/

It doesn't, that is an issue with how UNIX terminals came to be, and the whole backwards compatibility pretending that an HiDPi screen is a VT 100.

Terminals on other operating systems that grew up with a framebuffer don't have this limitation.

What would happen when you use `cat` in Ratty then?
We are one step closer to the terminal in the movie Hackers, and I am all for it.
"Don't worry, all of these dependencies are worth it."

That had me in stitches.

I was gonna comment here "real TempleOS vibes" then the TempleOS logo appeared a moment later in the demo video.