logoalt Hacker News

SSH is a GUI framework

158 points • by teledream • last Saturday at 2:52 PM • 78 comments • view on HN

Comments

orbital-decay • yesterday at 8:46 PM

Terminal giving you a janky and limited remotely accessible canvas you can abuse to make primitive GUIs doesn't imply that "SSH is a GUI framework".

A lot better solution would be designing a compact, semantic, styling-independent remote access protocol that doesn't need bitmaps (unlike most currently available protocols), and uses good compression for actual pictures/videos. That would make any GUI efficiently usable remotely through an adapter for an existing GUI framework, without extra bloat the browser has.

➕ show 8 replies
nico • yesterday at 8:33 PM

I remember my college used to serve some student services app via Telnet

You would just telnet into a machine using your student login/pass, and it would run either a welcoming screen or a specific app (like one for scheduling classes)

It was a very mature application and worked really well. Alas, it was quickly replaced by web versions of the apps, which took another flew years to get properly working

Anyway, glad to see an example of what’s possible (and almost forgotten), in terms of providing access to applications online via the terminal (and without a browser)

➕ show 3 replies
xxpor • today at 12:11 AM

For TUIs, I wish a 5250-style block based terminal had won over VT100 stream based terminals.

For those not familiar, with a block oriented terminal, the native "chunk" of data is an entire screen. So you can put information in there like "this is a text box". This allows, for example, you to move around the screen with tab and type _with no round trip back to the server_. There's 0 latency. Data is only sent when you hit enter.

On high latency or flaky connections the experience is a million times better.

➕ show 1 reply
davidgnz • today at 12:25 AM

> The Kitty terminal uniquely supports a file upload feature

If anything, Kitty was late to the party here. Being able to upload (and download!) files has been a fairly common feature in terminals since at least the 80s. Windows 95 even had a terminal that could do this (badly) included right there on the CD.

keito • today at 12:25 AM

I recently went down this rabbit hole (Kitty as streaming remote screen transport) but in the context of an IBM PC emulator[^1]. I think of it mostly as a gimmick, but I am impressed with the author's optimization work (text overlays, partial updates). In my case I found indexed PNGs to be a good way to reduce bytes across the wire, even trouncing zlib transport (I only needed 16 colors because CGA, so 4-bit indexed color was enough). Perhaps if enough people care about streaming graphics over Kitty it can be made into a more optimized thing :)

[^1]: https://news.ycombinator.com/item?id=50536648

alex7o • yesterday at 8:26 PM

I thought that this would be about x11 forwarding but this is also pretty cool

➕ show 2 replies
goranmoomin • yesterday at 8:48 PM

Before we start abusing the terminal protocols for GUIs, I believe that we need some kind of protocol to allow text selection and copy/paste between blocks of text, so that we don't need tools that trim whitespace that was copied from the terminal[0].

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

[3]: http://superlogical.com/

[4]: https://www.superlogical.com/rex/

[5]: https://news.ycombinator.com/item?id=48728766

➕ show 1 reply
Dwedit • yesterday at 11:02 PM

Once you start putting in the GUI features, you're competing with VNC and Sunshine/Moonlight.

➕ show 1 reply
rvz • yesterday at 8:41 PM

I don't think this makes any sense, as ssh isn't suited for this use-case.

It also doesn't make much sense to bring all the security problems that exists in web browsers into a terminal delivered via SSH because you want to render special escape codes such as kitty or even sixel that make it possible to achieve remote code execution in someone's terminal. [0]

Absolutely no thanks.

[0] https://ii4gsp.github.io/iterm2-rce/

➕ show 1 reply
qurren • yesterday at 8:26 PM

eeh using sixel or other sub-character graphics to render a GUI isn't really a feature of ssh. It's just a terminal feature, you could do it with telnet.

also related: i created a tool to show ROS topics over a terminal, intended for people debugging robots over ssh: https://github.com/dheera/rosshow

For better compatibility I used Braille characters to render a 2x4 grid per character, not sixel.

➕ show 1 reply
amelius • yesterday at 9:07 PM

makes me wonder: if a tool can do almost everything then doesn't that mean its attack surface is also unnecessarily large?

st_goliath • yesterday at 8:32 PM

> SSH is a GUI framework

By that logic, TLS is a web browser.

I was originally going to quip that by the articles logic, VNC should be a GUI framework too, but it is actually mentioned in the article. However, the text under the headline goes weirdly off the rails talking about webkit, WASM and WebGPU.

➕ show 1 reply
Aqueous • today at 4:44 AM

uhm...no it isn't?

This is entirely nonsense.

daylily • yesterday at 8:41 PM

Really doesn't seem like it would have great accessibility, but I suppose that ship has sailed with the proliferation of TUIs.

➕ show 1 reply
lnxsxu • yesterday at 8:53 PM

ok so wayvnc already gets told by the compositor which parts of the screen changed. being able to select the terminal text is cool. did i miss the bandwidth and input lag numbers for the same workload at the same image quality or did we just skip straight to “beats vnc”?

➕ show 1 reply
daylily • yesterday at 9:14 PM

I'll try to pick apart this paragraph in specific:

> While webapps have advantages, especially in client-side state, WASM, and WebGPU, they don't really capture the universality and ease-of-use of an SSH session. SSH keys double as authentication, and -A allows you to SSH into servers from within a remote microVM itself. Webapps also can't be accessed from a pure TTY.

> SSH keys double as authentication

Which is true! They are also typically associated with more than one service so rotation is a lot more painful.

> and -A allows you to SSH into servers from within a remote microVM itself

You can, indeed, also run a proxy on a remote VM and then access a web application via that VM! I don't think there's a practical distinction here.

> Webapps also can't be accessed from a pure TTY.

...And which tty would be able to render those special escape sequences without going through a terminal emulator?

I'll stay on the web.

cozzyd • yesterday at 8:55 PM

Apparently there are some brain-damaged terminals (e.g. warp) that instead of using normal ssh launch some remote helper process that opens one worker thread per core that all wake up at the same time. Which is great fun on a 192 core shared systemm. Fortunately a cgroup task/cpu limit will neuter them and other abusive programs like vscode-server.

gjvc • yesterday at 11:12 PM

it's a transport

TZubiri • yesterday at 10:21 PM

is bash a GUI framework too?

messh • yesterday at 9:29 PM

[dead]

listinglens • yesterday at 10:38 PM

[flagged]

arjunghose10 • yesterday at 9:01 PM

[flagged]