Remix.run Logo
▲ tptacek 6 hours ago

I love this work and everything else Ratatui does but I have to ask: if you're changing the terminal protocol and the terminal itself to do this, why not do something more ambitious; a full monospaced information-dense UI framework, a terminal designed for user interfaces, rather than one designed to replicate the limitations of dumb terminals?

▲joshka 4 hours ago | parent | next [-]

Yep,and I want to do that too :)

I've written about it before, but in brief the mountain of standards is worth ripping out wholesale and doing write as a semantic protocol. It's needed to solve several things that work really poorly in terminals because their unit of compatibility is cells rather than a higher primitive. It's hard to bake something on top that works well.

The need is most strong in Accessibility, Text wrapping, Scrollback handling (i.e. making the scrollback editable and not dead text), and various other bits that make writing highly functional TUIs. Coding agents tend to find all those edge cases.

This often gets push back that it's easy, to which I can point nay sayers at the various many months long issues on things in Codex, Gemini, Claude etc. on flickering, scrolling, key handline, IME, ... doing anything moderately complex involves modeling a terminal in a terminal app effectively.

Ghostty and Rex sort of do the opposite bit. If you think of it like a stack, they write a new layer underneath that transports the cells on a better multiplexer layer 0. I think a new semantic layer 2 is an approach that would be neat to work with.

▲tptacek 3 hours ago | parent [-]

I think I mostly just want to see someone do it so I can see what it looks like; it just feels like something that should exist. You're taking baby steps towards it! :)

▲joshka 3 hours ago | parent | next [-]

I kinda keep talking about it in the hopes that someone will be nerd sniped enough to throw tokens at it as an idea. Sort of what you're probably doing too I guess. ;)

▲josephg 39 minutes ago | parent [-]

... Write up a more complete spec of the problem and I could be tempted to throw some tokens at it. But before I do, can you write up a more complete description of the problem with existing terminal protocols? I don't think I understand the issues well enough to make a good solution. Eg, can you give some examples of what apps are hard to build now? What prior art is worth looking at? Etc.

▲kalaomer 9 minutes ago | parent | prev [-]

[flagged]

▲fc417fc802 4 hours ago | parent | prev | next [-]

> a full monospaced information-dense UI framework, a terminal designed for user interfaces, rather than one designed to replicate the limitations of dumb terminals?

I can only speak for myself but I use the CLI and TUIs specifically because of the limitations those modalities impose on software that uses them as the primary method for interfacing with the end user. If you want a full featured UI and all that comes with it why not just use QT or GTK or modern HTML or etc?

I think the only "improvements" I'd like to see are thing such as metadata regarding what the different streams are for, an official way to communicate using structured data as opposed to raw bytes, that sort of thing. Spiritually in the same ballpark as the difference between HTML before and after CSS.

▲unshavedyak 5 hours ago | parent | prev | next [-]

I actually am exploring exactly this. Ironically from the perspective of someone that was trying to leave the Terminal.

How i got here i find kinda interesting. Originally i was trying to leave the terminal. Using GPUI/etc frameworks. I kept running into the terminal though, because no matter how nice the UI is - the terminal still needs to work excellently.

Eventually i decided to try an abomination. To use a custom terminal which, not unlike Kitty images, allows generic apps to pass escape codes to control the UI components. Where the UI components have no restriction on "dumb terminals". So my text editor is a two part app, an editor and a tty to render the actual custom UI APC codes.

This paved the way for true smooth scrolling from within a terminal editor, as the editor effectively paginates but the tty scrolls within the buffered pages. It allows for different UI components to mix fonts and font sizes, eg popup docs being a different size than the other text, and .. well, anything i suppose.

I have to say it's working excellently and is slowly becoming my daily driver. I won't link it though, it's a fully vibe coded and even claude designed horror.

I'm surprised i've not seen more of this in the past to be honest.

▲kodoman 3 hours ago | parent | next [-]

I am running ewm (not exwm) which makes emacs into a wayland compositor and it's fantastic, most of the primitives dissolve and you script it with elisp, wayland windows are just a special buffer and where applicable normal windowing and buffering rules can be applied.

The developer seems to have used AI heavily in the elisp code and it works very well.

▲skydhash 3 hours ago | parent | prev [-]

> To use a custom terminal which, not unlike Kitty images, allows generic apps to pass escape codes to control the UI components.

> I'm surprised i've not seen more of this in the past to be honest.

This is what emacs is. It's a text buffer, but text can have properties like how to render, and custom values. then a bunch of commands to manipulate the buffer and it's contents.

▲kccqzy 3 hours ago | parent | prev | next [-]

You can save all that effort and instead come up with a CSS framework that enforces monospaced fonts, uniform font sizes, encourage information-dense layouts, have borders that don’t take up a cell (border: solid 0.1rem black; padding: 0.5rem;). Pair it up with a small JavaScript framework that listens to keypresses and buffers them. Furthermore, the framework makes the user decide on fonts, whether to allow images, whether to adhere to a strict character grid etc.

▲eviks an hour ago | parent | prev | next [-]

Or even more ambitious - ditch the monospace

▲joshka an hour ago | parent | next [-]

For a while in the 2000s I tried programming with Verdana in my IDE at the time. It wasn't all that bad. It would be in a terminal however - fun idea regardless.

▲nepthar 30 minutes ago | parent | prev [-]

Have you tried this? It’s awful

▲eviks 26 minutes ago | parent [-]

Tried what? It's not supported now, everything is a fixed grid

▲octoberfranklin 3 hours ago | parent | prev | next [-]

Because it will turn into the kitchen-sink mess that the Web is.

Terminals work so well because there's a huge frictional cost to adding to the protocol. That's what keeps the protocol simple, which is what keeps multiple implementations feasible. Unlike the web, where unless you have GoogleBux you can't afford to implement it properly.

▲ant0ni an hour ago | parent | prev | next [-]

everyday we get closer to building emacs

▲hedgehog 5 hours ago | parent | prev [-]

Text terminal with every keystroke round-tripped through the server is not a design that makes sense for any reason other than backwards compatibility. It's kind of annoying to design for and atrocious for performance.

▲toast0 5 hours ago | parent [-]

Teletypes and dumb terminals managed to implement local echo. You don't need to round trip everything.