by goranmoomin · 1w ago · 0 comments
There's some prior work like how the OSC-8 hyperlink id param[1], and a specification to tackle the issue[2].
I'm hoping that the Superlogical folks[3] can actually do this, in libghostty and Rex.
But also in tangent, I also do think that abusing the terminal protocol to do GUI stuff is kind of a worse-is-better type of situation, we specifically have a protocol (Wayland, Quartz, and so on) to do this stuff, and I'm hoping that we can decide to actually do something similar for the remote GUI situation. I believe that the Superlogical folks have plans to do this with Rex[4].
I believe that the remote-GUI situation has to be resolved, I've been talking about this multiple times. I thought that the web stack (HTML/CSS/JS) would be the answer to adoption[5], but hopefully we can get a full-fledged solution that is compatible with the previously existing GUI apps as well.
> - TUIs are not inherently superior to GUIs
> - SSH, as a transport layer, should support not just forwarding a pty (as a TUI display layer), but a GUI display layer as well
> In fact, these two arguments were already realized by UNIX 30 years ago, and we already have one solution: the X protocol and ssh -X.
> Unfortunately, X did not win out. We did not get the promised future where one can ssh -X into a remote machine, run gnome-control-center, and a settings window pops up and I can configure my remote computer. (If you believe that this works, try it out yourself. It is an abysmal experience.)
> However the above needs still needed to be satisfied by so much people, and apps that needed it started to be developed as web servers, stuff like jupyter notebooks. It turns out that the web’s document format coupled with a styling solution and a client-side scripting language, with all of its warts and drawbacks, became a viable solution as a display layer for interactive apps. In fact, since it started from remote documents, network transparency is built-in.
> It would be dumb to not realize that the HTML/CSS/JS stack did win a dominant position for desktop apps, with all of the Electron apps, and utilize the web as a display layer for the above. I see the project in a similar vein, i.e. utilizing HTML/CSS/JS to provide a display layer for remote apps via SSH.
> Also note that Electron apps has the same split with X, where the display server and the client are separated: it's called the "renderer process" and the "main process", and the two processes talk via IPC (where the display server would be the renderer process running embedded Chromium, the display client would be the Electron main process, and the stuff that the client sends to the server would be the contents of the renderer JS bundle). I think, theoretically, it would be possible to run the main process separated from the renderer process on a different machine, with an appropriate IPC transport. I think this would be not far from the above idea?
[0]: https://tools.simonwillison.net/cleanup-claude-code-paste
[1]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3c...
[2]: https://gitlab.freedesktop.org/terminal-wg/specifications
That said, current terminals definitely have rough edges. Being somewhat "dumb" clients keeps the attack surface smaller, but it's also quite limiting. To address this (while keeping standard terminals working), I've been working internally on a prototype terminal client to hopefully get things smoother, which I'll share updates when it's ready, along with any open-source projects that come out of the infrastructure it needs.
I heard of Superlogical whilst initially working on Zydra, though I somehow missed the release of Rex, it's definitely something I'll have to look into.
Thanks for such a thoughtful comment.
On the flip side, cross-platform GUI frameworks already exist. HTML+CSS are really great, with everything you need and more built-in already, and none of the jank running in a 1970s-based terminal brings. If you want reduced attack surface I would say it makes more sense building (or forking) a browser engine with just the features you need, keeping compatibility with other browsers so nobody is forced to use yours.
And we actually do have a webapp too, and it's alright, but I prefer SSH. To me, the project is more of a "multiplexer-on-steroids" with a built-in microVM to hold its apps and graphics, rather than a simple remote desktop. You wouldn't run a multiplexer over the browser just because it technically has everything built-in.
In the case of VNC/other protocols, there is an asymmetry: if you embed text in VNC, it still has to be streamed as graphics, whereas if you embed graphics in SSH, you can still stream text as actual text.
Fun fact: Our webapp does stream many elements as HTML (including even Wayland apps) rather than just streaming them using a codec.
> whereas if you embed graphics in SSH, you can still stream text as actual text.
I agree with you here that remote desktop sucks but, honestly, terminals suck too. They both make different tradeoffs to accomodate graphics at the expense of text, or text at the expense of graphics. With something like HTML+CSS you don't compromise on either because it has first class support for both text and media.
I highly recommend that you give Claude (desktop, not the TUI, make sure you use Code in it) a try because it is a much better experience IMO. You have a GUI chat with nice text rendering, selectable/dictatable, and mixed media into it. And you have panels for things like your diffs, terminal, and browser to see what it's building. Basically what you've built except runs locally, which goes against what you're building, but it is a good example of what you could build by ditching the terminal.