SSH is a GUI framework

(zydra.sh)

110 points | by teledream 4 days ago

19 comments

  • orbital-decay 2 hours ago
    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.

    • rpcope1 2 hours ago
      So basically expanding on remote X11/X forwarding?
      • orbital-decay 2 hours ago
        X forwarding is the complete opposite of that - it's non-semantic, doesn't abstract away styling, heavily relies on bitmaps, and generally a lot noisier than a terminal. It needs to be replaced with something better thought out for GUI remote access to be a viable alternative. Same goes for SPICE (as far as I remember how it works).
        • wahern 1 hour ago
          The X protocol is semantic[1] and when used as originally intended is very fast even on 1990s networks. But GUI toolkits ended up heavily relying on local rendering and shipping bitmaps over the wire, which is why Wayland advocates argued bitmaps are good enough.

          It's kinda like the way PostScript evolved into early PDF which evolved into modern PDF, where pages are basically assemblies of prerendered images. The original, semantic aspects are still there, just not used, or rather abused to dumb it down.

          [1] At least in the way you mean. Semantic like SVG, which is still literal, just abstract.

          • whartung 1 hour ago
            I remember running the original Citrix client for Windows over a 14k modem.

            It worked remarkably well, the only real nut was the typical “splash page” on launch, which was typically a large bitmap. Those stalled pretty hard, but once you got past that and up and running, apps were quite smooth over the crummy bandwidth.

        • hnlmorg 1 hour ago
          I’ve not done X forwarding in decades but it definitely was semantic and abstracted styling back when i used it to connect to Solaris boxes over dial up.

          Maybe the bitmap problem was an issue with modern DEs? Many of them were likely bitmap-heavy for window chrome anyway.

          • nine_k 28 minutes ago
            Modern toolkits are optimized for GL rendering and the shared memory extension. They produce beautiful effects and animations, and give the X server large bitmaps already in VRAM, much like a video player.

            Toolkits like Athena back in the day dealt in terms of lines, rectangles, and text strings to be rendered locally, more like, say, HTML does.

            The latter approach did work over dialup. The former struggles to be smooth even over 100mbps Ethernet.

      • miohtama 54 minutes ago
        How about HTML/CSS/JS
    • teledream 1 hour ago
      I mean, one could argue that the web is just a remotely accessible hypertext protocol we've been increasingly abusing to make whatever arbitrary GUIs we want.

      I've always wanted a styling-independent protocol, which led me to the Gemini protocol (not the AI) for one, although I find that all such "next-generation" protocols don't see much traction.

      I picked SSH as a convenient option that people already use to log into VMs.

    • XorNot 1 hour ago
      The problem is a web browser is exactly that use case. Their whole function is to remotely render a GUI.

      We gripe about web design when people start to act more like it's local, but all the things a browser does are essentially "I need a remote GUI" and a lot of effort has gone into that.

      • icedchai 1 hour ago
        A terminal with an HTML/CSS embedding mode would be interesting.

        In the BBS days, there were some attempts to move beyond ANSI escape sequences, like RIPscrip: https://en.wikipedia.org/wiki/Remote_Imaging_Protocol

        Once the web took off, all that stuff disappeared...

        • breuleux 1 hour ago
          I made something like that a while ago: https://github.com/breuleux/terminus

          I'm currently working on something far better that allows for true interactive widgets over SSH (that does already work), but in my quest for perfection I'm about to rewrite the protocol for the third time, so I don't know if I should share that :P

      • messh 57 minutes ago
        the main difference between web UI and a terminal is that a terminal streams instructions. For HTML you usually need a whole program that compiles
      • zokier 1 hour ago
        it is annoying how poorly web browsers support the local or ssh tunneled application use case though. it would be nice if there was a way to get browsers to work more like X servers, presenting an unix socket that applications (either local or ssh-tunneled) could connect to. Or something along those lines.
      • orbital-decay 1 hour ago
        Modern web is a terrible abuse of what was originally a document viewer. A web app is not even in the same league with a TUI when it comes to remote access. It needs to be designed specifically to stay as noiseless on the network as a TUI app is by default, and the browser is incredibly janky and bloated, which is not avoidable. Don't worry though, modern TUIs are headed towards the same direction, because people want more and more features in a legacy thing instead of designing one for the purpose.
    • bflesch 2 hours ago
      how does hyper gui transfer protocol sound? :)
      • Exoristos 2 hours ago
        How it sounds depends on how you pronounce GUI--do juniors say "gooey," or has that passed away with "sequel" and "clee"?
    • ireadmevs 1 hour ago
      I'd propose we define some kind of hypertext markup language. Probably allowing the app send some default cascading style sheets would not be bad, but we should be able to apply our custom ones over it. Then we find a way to represent our state transfers between the client and server.
    • coldtea 1 hour ago
      >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".

      Sure it does.

      >A lot better solution would be designing a compact, semantic, styling-independent remote access protocol

      Sure. But something being a better <thing> doesn't mean something less good is not <thing>.

      • orbital-decay 1 hour ago
        Well, for one SSH != terminal, and a framework is supposed to be a lot more than just a canvas...
    • whywhywhywhy 52 minutes ago
      Ultimately there's so little actual programming going on now it's automated with AI that larping is filling the time.
    • kccqzy 1 hour ago
      That better solution is known as plain HTML over HTTPS. The user can write their own styles. The user can prohibit <img>s or selectively allow them.

      But yeah the author is probably deliberately conflating between the Terminal which renders and the SSH protocol which just transports streams securely. It makes the title more enticing.

  • nico 2 hours ago
    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)

    • abbbi 52 minutes ago
      back in the days, we had a usual meeting every friday to eat white sausages. Its a thing to do so here in bavaria.

      I entered internship at that company back then and all participants would connect the mainframe via telnet to place their orders on how much they want to eat. It was a terminal driven UI .. Right at 11:00 it was not accessible anymore and the orders were printed. A person would then go and place the order on a nearby butcher and retrieve it, prepare the meal and everyone was happy.

      I had to replace it with a (back then) hacky php site, which is still in use, as of today, nearly 26 years later.

      lol

    • wing-_-nuts 1 hour ago
      I remember back in the mid 90's, I was a young high school student taking a c programming class (in rural alabama, no less!). We used a borland ide / compiler, and I was irritated that I couldn't code at home.

      I was reading a forum online, and someone mentioned that the university of Colorado offered free shell accounts, and they had compilers!

      Well, it was a bit different than borland, but I was really happy to be able to code after school, at home. I kept bugging the UC admin to install x, y or z software and he finally said 'hey, kid, there's this thing called linux, you can put it on your home computer'

      So of course I formatted my parents home computer (they were...not amused), but I loved the whole ecosystem. I had access to tons of code to learn from. It was awesome.

      That was really my start into being a software developer, and all because some admin at a university was kind enough to allow the general public to use their servers.

    • Telemakhos 2 hours ago
      I remember those days, and getting mail by telnet. I wonder what would happen if you asked college kids to ssh in to a server today instead of giving them a web interface. I think it could be a big plus for them to see some sort of computing that isn't packaged the same way as everything else, namely as a web page.
  • Dwedit 5 minutes ago
    Once you start putting in the GUI features, you're competing with VNC and Sunshine/Moonlight.
  • Sha1rholder 2 hours ago
    • g8oz 0 minutes ago
      I like it.
  • alex7o 2 hours ago
    I thought that this would be about x11 forwarding but this is also pretty cool
    • teledream 2 hours ago
      Thanks :)

      I do really like x11 forwarding, but unless you're on Linux, you'd need to download an X server, so I thought this would be interesting as something anyone could try from almost any machine.

    • k0dyn 2 hours ago
      Me too - my initial thought was "Ooh, did someone just discover the -X flag?"

      But nope, now I'm feeling old again.

  • goranmoomin 2 hours ago
    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

    • teledream 2 hours ago
      "Worse-is-better" is really perceptive. Using SSH as a GUI is admittedly a dirty solution, but I find it practical. See, if I tried to build a cross-platform app supporting X11, Wayland, Windows, and macOS, then I'd really be making a GUI framework, and if I tried to abstract all of those universally, well, I'd still be making a GUI framework. Thus the case for SSH presents itself.

      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.

      • myaccountonhn 1 hour ago
        How about just a website you serve over wireguard? Can even be turned into a tui with w3m
  • rvz 2 hours ago
    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/

    • teledream 2 hours ago
      That's a fair concern. Any escape-sequence parser can have unknown vulnerabilities, and terminals don't have browser-grade sandboxing. Still, it's quite a different, much smaller attack surface than a browser downloading and running untrusted client-side code (JS, WASM), and a much easier one to harden over time.
  • qurren 2 hours ago
    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.

    • teledream 2 hours ago
      Braille is really interesting as something more universal. Cool project.

      It's true, SSH is just the tool of choice to move bytes around, and it's up to your terminal emulator and the server to decide what those bytes mean. In practice, SSH gives you encryption, key auth, and a way past restrictive firewalls (we listen on port 443 for this exact reason).

  • listinglens 29 minutes ago
    [flagged]
  • messh 1 hour ago
    [dead]
  • st_goliath 2 hours ago
    > 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.

    • getfacl 47 minutes ago
      You could switch to telnet and everything in this article would still work.
  • daylily 2 hours ago
    Really doesn't seem like it would have great accessibility, but I suppose that ship has sailed with the proliferation of TUIs.
    • Eduard 2 hours ago
      as if CLIs were designed for general accessibility
      • daylily 2 hours ago
        I think they are? They (mostly) output a stream of text where the order of the text matches the structure of the underlying information.

        TUIs with their box-drawing characters and emulated 2-d layouts, on the other hand, are not. I think Claude Code really set a bad example here that got everyone interested in making TUIs again.

      • munk-a 2 hours ago
        They are. Text based interfaces are the easiest to transform into other media - accessible and pretty aren't the same thing.
  • lnxsxu 2 hours ago
    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”?
    • teledream 1 hour ago
      I'm not necessarily saying SSH wins on a raw codec benchmark against wayvnc (I'd be glad to test it though, and I am working on a faster native client).

      It's that the whole workflow has been built around SSH. I haven't just bolted a VM's "display_1920x1080" onto a Kitty stream and called it a day. Here I have a microVM that in and of itself renders natively to SSH, bringing with that SSH's key auth, and a universal client you can run on any terminal (with a text-only fallback).

      Put simply, I don't enjoy remotely streaming a clunky desktop display, even if it's technically "fast". SSH feels at home, and that's why I built desktop VM infra on it natively.

  • daylily 1 hour ago
    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 2 hours ago
    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.
  • TZubiri 46 minutes ago
    is bash a GUI framework too?
  • arjunghose10 2 hours ago
    [flagged]
  • amelius 2 hours ago
    makes me wonder: if a tool can do almost everything then doesn't that mean its attack surface is also unnecessarily large?