Ratty – A terminal emulator with inline 3D graphics

ratty-term.org

674 points by orhunp_ 6 days ago


mncharity - 5 days ago

A couple of comments here mention using this in VR. Fwiw, years back I played a bit with shallow-3D UIs for software dev. Shallow like within a few cm of a laptop display, to minimize VAC eye strain for all-day use. Think more being able to layer and draw in color, but in 3D, rather than waving arms in a room.

The 3D can be wiggle 3D, or perspective from webcam head/eye tracking, or stereo from shutter glasses, or XR HMDs. Wiggle is easiest - just move the object orientation back and forth. Cute but distracting. Well, cross/parallel-eye gaze is easier, but limited - ok for little UI test swatches. Perspective is more subtle, less intrusive. Can be simple with a head tracker driving a single orientation, or go all in with eye pose (for distance) and window locations, to do an accurate 3D render. App stereo pairs can be "I give you two windows Left/Right-eye", or "alternating L/R view, labeled/synced/polled". Other possibilities. Many of these need window system/manager/desktop support. I found a lot of leverage in using a stack of electron and X.

It's fun to displace text in 3D. Like colorization, but more so. And if you don't mind a cluttered appearance, you can add secondary information layers segregated by depth. And... etc. Emacs with characters-have-a-depth finally gets you something LispMs didn't have. Fun aside, to explore possibilities with code text, with anything not inherently 3D, far easier to prototype UX with fg/bg colors, fonts, unicode, and animation. Or in browser, overlaid divs and transparent 2D/3D canvases.

pjmlp - 6 days ago

UNIX still trying to catch up with Xerox workstations in the REPL experience, or general Lisp machines for that matter.

Inline graphics from 1981,

https://youtu.be/o4-YnLpLgtk?t=376

noelwelsh - 6 days ago

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/

sigseg1v - 6 days ago

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?

amelius - 6 days ago

Terminal is slowly becoming a full featured web browser.

iugtmkbdfil834 - 6 days ago

Rip Terry. May you never be forgotten.

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

joouha - 5 days ago

It's very interesting to learn about the newly proposed glyph protocol [1] in the linked blog post. I was bemoaning the lack of exactly this here about 6 months ago [2]!

[1] https://rapha.land/introducing-glyph-protocol-for-terminals/

[2] https://news.ycombinator.com/item?id=45805072

CTDOCodebases - 6 days ago

"Don't worry, all of these dependencies are worth it."

That had me in stitches.

ghostoftiber - 5 days ago

This reminds me of when compiz came out and everyone was like MY WINDOWS ARE ON A CUBE and I NEED WOBBLY WINDOWS.

So anyway, being that guy, I immediately installed it.

pelagicAustral - 6 days ago

Can I really render a 3D rat on my terminal? If I can then I'm sold.

arkwin - 6 days ago

We are one step closer to the terminal in the movie Hackers, and I am all for it.

zackoverflow - 5 days ago

This is kinda possible already today with the Kitty graphics protocol, I made a demo here of rendering 3D graphics[1] with kitty. The actual important missing thing (and which ratty seems to also not include) is vsync.

If rendering is not aligned then it's possible for the terminal emulator to read the framebuffer while the application is writing to it, causing visual artifacts.

[1] https://x.com/zack_overflow/status/2035921425341763756?s=20

JSR_FDED - 5 days ago

This is pure Hollywood OS - hackers feverishly entering obscure incantations like “upload virus”…but now with the terminal twisted into a Moebius strip!

darkwater - 6 days ago

What would happen when you use `cat` in Ratty then?

liamwire - 6 days ago

You had me at spinning rat cursor

basilikum - 6 days ago

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

mohamedkoubaa - 6 days ago

Emojis in a terminal are a step too far for me. This is just... Indulgent.

Panzerschrek - 5 days ago

The question is - why do we still need the terminal abstraction at all?

quotemstr - 5 days ago

Cool.

Seriously, though, when are we going to see the convergence of terminals and GUI remoting protocols? People have already departed far from Unix pipeline utilities. "TUI" programs are already GUIs in disguise. Why keep pretending that the terminal (as used by TUI programs) is a different kind of thing?

alexprengere - 5 days ago

If this turns out to exfiltrate all my keys, I will have some explaining to do to my security department.

silon42 - 6 days ago

IMO, next crazy step is for terminal to just have wayland or X11 protocol ? (/s or not?)

mnorris - 5 days ago

I built DeepSteve (https://github.com/deepsteve/deepsteve) with a similar itch but went the other way. Instead of adding graphics to the terminal, I put the terminal in a place that already has graphics.

I kept trying to optimize my terminal layout and realized I could just run my terminals inside of the browser, and let Claude Code write JavaScript in the same browser tab to customize the experience however I want. It's kind of a terrible idea, but it's my terrible idea, and I love it.

pawelduda - 5 days ago

This is so cool I'm sad I can't think of any use case for me

injidup - 5 days ago

Anybody remember "wobbly windows"? It never sticks.

gosub100 - 5 days ago

Has anyone tried to create 3D fonts? It sounds like a ton of work but might look cool if done correctly.

You could also do really cool text highlights by working with light sources and shader effects

Another feature I'm looking for is smooth scrolling when you hit enter. I've had debates before where they claim it's not possible, that the text must jump one line. But I think it's possible, by shifting the frame buffer up.

- 5 days ago
[deleted]
voidUpdate - 6 days ago

I was going to comment how it reminded me of TempleOS and the author should look into that, but the accompanying blog post explains how it was inspired by it https://blog.orhun.dev/introducing-ratty/

2ndorderthought - 6 days ago

I actually see some use cases for this. It's one of those should be nonsense projects that somehow isn't.

HumblyTossed - 5 days ago

How long until we have a web browser in a terminal (not just Lynx, but a full on web browser)?

slopinthebag - 5 days ago

Remember when the Claude Code devs claimed that CC is a game engine?

This is a game engine.

zhxiaoliang - 5 days ago

I’m not sure why I’d use it, but I enjoyed the visual and loved the brutalist design of the website -- it brought back some fond memories of the good old days.

tootie - 5 days ago

Make me think of the infamous Unix scene in Jurassic Park.

lackoftactics - 6 days ago

Hantavirus inspired?

PunchyHamster - 5 days ago

It's funny when terminal emulators add shit like that but search in windows names/content ? nah who needs that

whywhywhywhy - 6 days ago

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

gorgoiler - 5 days ago

Hah, reminds me of the Quantel broadcast equipment on the 1990s. Why fade to black when you can fade to 3d butterfly!?

shevy-java - 6 days ago

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.

commieneko - 5 days ago

It's like someone crossed an 80s Silicon Graphics workstation with a Vic-20.

I, Beldar, approve.

Levitating - 5 days ago

I have been waiting for a proper implementation of this since forever. Thanks orhun.

rs545837 - 5 days ago

Damn this was really fun to use.

rexthonyy - 5 days ago

That's quite cool, visually pleasing to the eye and high on data usage.

cr545l - 5 days ago

You can also use the kitty protocol or sixel in modern terminals.

hartjer - 5 days ago

"Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should." - Jeff Goldblum (OG Jurassic Park)

chakintosh - 5 days ago

People complain about token limits

Then spend their tokens on abominations like this

Make it make sense

muyanapar - 5 days ago

Amazing project and the ratatui community is really wholesome :,)

neomantra - 6 days ago

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....

lupodevelop - 4 days ago

I don't know. mixed feelings... but fine

namar0x0309 - 6 days ago

More of this please! Outside the box thinking! Yes and yes!

randusername - 6 days ago

Here's the bit from the blog post about it:

> When I first got introduced to [TempleOS], I was shocked and impressed by the flashy colors, graphical sprites and uncomprehensible UI. There are so many things that makes it so unique, weird and fascinating at the same time, somehow.... Basically, the command line becomes the direct interface for everything. You can write code, interact with the system and render graphics all in the same place, which is why TempleOS feels so unusual compared to conventional operating systems.

I think this could be a really cool approach. I enjoy tools like Chafa, imgcat, etc but something always feels a little clunky about the separation between text and images. Paradoxically having text and non-text all jumbled up like this feels better somehow.

sscarduzio - 5 days ago

Well deserved HN #1

austinrm - 5 days ago

Excited to see others equally inspired by TempleOS’ 3D feature :)

I tried something similar a few months ago that acts more as a library to ratatui than a separate terminal emulator [0].

Was surprised how far one can get using some off the shelf characters like half-block when rasterizing.

The Glyph protocol mentioned in the blog post is interesting … perhaps custom glyphs could help smooth some of the (literal) rough edges from the low effective resolution of a terminals character grid.

[0] https://github.com/limlabs/ratatui-3d

olivierestsage - 6 days ago

In a world of slop, one truly noble project emerges

sgt - 6 days ago

How do I enter zoom mode or pan mode?

HackerThemAll - 5 days ago

What a twist, having textual window manager within a graphical user interface, and that textual window manager implementing bits of graphics.

You'll soon may be able to implement overlapping graphics windows in TUI within GUI.

This is stupid af.

xantronix - 5 days ago

Was this aided with LLMs or purely for the love of the game? I don't see an AGENTS.md or anything similar in the repo.

brunoborges - 5 days ago

Cool... why?

LennyHenrysNuts - 5 days ago

This is gloriously bonkers.

wolvoleo - 6 days ago

This would be nice in VR

holg - 5 days ago

it is the fantastic tool!

gariti - 5 days ago

last night I was pondering if there was a ghostty plugin that can make my terminal like the opening scroll from a Star Wars movie. Can we make that happen?

dstnn - 5 days ago

Friggin waste of resources

nickcageinacage - 6 days ago

so cool. well done

iugtmkbdfil834 - 6 days ago

Dude. Congrats. You actually made a compelling argument to put rust on my machine:P

kandros - 5 days ago

Expect to see Orhun in here before clicking, not disappointed

semiinfinitely - 5 days ago

temple OS?

Bluescreenbuddy - 5 days ago

Another terminal to murder your battery life

ceayo - 5 days ago

why would you want this?

Lucasoato - 6 days ago

Imagine this with VR dev environments!

nialv7 - 5 days ago

Terry A. Davis will be proud

BaardFigur - 6 days ago

Reminds me of TempleOS

drakythe - 5 days ago

My first reaction: "But why?"

My second reaction: "Oh wait is that TempleOS being cited? This is either awesome or terrible."

lioeters - 6 days ago

> inserted 3D objects in the demo above are actually from the TempleOS codebase itself

Brilliant. The dream lives on! This is the best form of paying respects.

It's walking a fine line between madness and genius, and who knows if it'll ever be practical, but more important is the sense of wonder and "fuck yeah" as King Terry expressed so eloquently.

alexvkw - 5 days ago

Thanks. I hate it

ruler88 - 5 days ago

y tho?

infoinlet - 6 days ago

[flagged]

globalcostdata - 5 days ago

[flagged]

specwiseai - 6 days ago

[flagged]

openclawclub - 6 days ago

[dead]

- 6 days ago
[deleted]
user5589 - 6 days ago

[flagged]

tester121 - 6 days ago

[dead]

animanoir - 5 days ago

[dead]

cgaooo - 6 days ago

[dead]

soupspaces - 6 days ago

[dead]

rullelito - 6 days ago

Can anyone explain why this is novel? It seems pretty basic?