Remix.run Logo
theowaway213456 8 hours ago

You can tunnel a port over SSH and get a web UI locally, though it's not commonly done. I feel like more people would actually do this if tunneling a port was just ever so slightly easier (like, you're already SSH'd into a box, then you run a command, then you somehow automatically get a tunnel for that command's UI port plus a local browser window open to the page)

jasongill 7 hours ago | parent | next [-]

While in an SSH session, press enter, then type tilde and capital C (enter ~C) and you can add command line options to the current session. To add a port forward from your local 8080 to the remote port 80 without closing the connection, do:

  enter ~C -L 8080:localhost:80
Tepix 5 hours ago | parent | next [-]

Thanks. This could really benefit from a TUI!

zimpenfish 7 hours ago | parent | prev | next [-]

That is a neat trick. Added to the list.

(Ultimately unhelpful though because I use mosh everywhere these days and that doesn't appear to have anything fancy like this.)

dylan604 6 hours ago | parent | prev [-]

Maybe it's just still too early in the morning yet, but what is the significance of hitting enter first?

jasongill 6 hours ago | parent [-]

SSH expects the escape sequence (tilde) to be the first character on a new line; since backspace is sent as a character, you can't just backspace over something you've started typing and then press tilde to have it recognized.

Technically, you don't have to press enter if you've not typed anything (try it in a new SSH session - as soon as you are logged in, type ~? to get the SSH help output), but since the comment was about doing this during an active session without ending it, I figured noting that pressing enter first to be sure you're on a new line wouldn't hurt

yoz-y 7 hours ago | parent | prev | next [-]

I like TUIs because I run everything in tmux and I can just pick up work from wherever I was on any computer, phone or tablet.

DesiLurker 5 hours ago | parent [-]

share some good (easy on remembering keyboard & mouse) tmux configs. I usually struggle with copy pasting many scrollback lines from/to tmux. would love for my claude to be natively tmux aware.

wolvoleo 7 hours ago | parent | prev | next [-]

I do this a lot but I'd still prefer TUI where possible. With too much visual content it isn't of course, but for many cases a TUI is much more responsive and much lower resource.

surajrmal 6 hours ago | parent [-]

I largely agree with you, but there are limits to what a tui can do well. If analyzing a flame graph or performance trace, web UI is a better fit. However, most things are not that.

roywiggins 7 hours ago | parent | prev | next [-]

Even easier is just using an X server, if you have it set up properly you just need to run the remote app and the window pops up on your machine.

(I think terminal-based GUIs are neat just for fluidity of use- you can pop one open during a terminal session and close it without switching to mouse or shifting your attention away from the terminal. They can also be a nice addon to a primarily CLI utility without introducing big dependencies)

wolvoleo 7 hours ago | parent [-]

Yeah I love that about X. I remember in the 90s when I first figured that out. I was logged in from a university workstation into my home computer with SSH and I launched my mail client or something and I thought doh, stupid that will only popup locally.

Then colour my suprise when it popped up on my screen right there. Slow as molasses but still. Wow. Magic.

It's a shame Wayland dropped this. Yes I know there's waypipe but it's not the same.

coldpie 7 hours ago | parent | next [-]

> It's a shame Wayland dropped this.

It... really isn't. Like you said, remote X was barely usable even over an entirely local network. Most applications these days are also not designed for it, using loads of bitmap graphics instead of efficient, low-level primitives. So you end up being just one tiny step away from simply streaming a video of your windows. We have better tools for doing things remotely these days, there's a reason approximately no one has used remote X after the mid-90s. It's a neat party trick, but I don't blame the Wayland authors for not wanting to support it.

cbm-vic-20 5 hours ago | parent | next [-]

> one tiny step away from simply streaming a video of your windows

In the 80s/90s this wasn't feasible due to network latency and bandwidth, but it's pretty common now to do exactly this, with VNC and other remote desktop protocols.

wolvoleo 5 hours ago | parent | prev | next [-]

It is, there were tools like NX that made it entirely usable even latencywise. And these days we're really going more and more to remote computing.

In the time when wayland was invented it made sense because we did everything purely local. But now it's as outdated as X11 was in 2010.

And yes I still use it a lot. It works well. Networks have become a lot better and even most cloud compute I use is geographically nearby.

What made it slow back then was that I only had a 128kbit uplink at home. And the uni had 2 mbit for the whole computer science building :)

pseudalopex 2 hours ago | parent [-]

> In the time when wayland was invented it made sense because we did everything purely local.

People complained of no forwarding in Wayland when it was invented.

duskdozer 6 hours ago | parent | prev [-]

Like what? X forwarding has pretty much always been the thing most likely to work for me and I haven't been able to find any equivalent.

coldpie 6 hours ago | parent | next [-]

The big obvious one is web-based tooling. Your information & settings are stored on a server and you use a web browser to view it via whatever device you're on. For more locally based workflows, we have networked filesystem protocols, automatic syncing between systems, that kind of thing. It's not a 1-1 equivalent of running a remote program and viewing it locally obviously, but it gets the same job done, in a much more useful & flexible manner than X forwarding did.

For example, the remote mail client usecase I was replying to is simply done with a webmail client today.

duskdozer 6 hours ago | parent [-]

I don't really feel like web interfaces or syncing are really a substitute tbh, and I'm not sure how they're more flexible. ssh -> run -> gui opens, and the program itself doesn't need to be designed differently to work

coldpie 5 hours ago | parent [-]

> and I'm not sure how they're more flexible. ssh -> run -> gui opens

But this doesn't work on your phone, or on a Windows or macOS device, right? That's what I meant by flexible, X forwarding fits a pretty narrow set of usecases, while on the other hand keeping programs on the clients and data centrally located on a server allows for a whole lot more options for how to interface with that data.

(To be clear, nothing wrong with X forwarding! It's a cool tech and I'm glad you have a use for it! I'm just arguing that it's fine for Wayland to not try to support that kind of thing, because we've got other ways of working remotely now.)

pseudalopex 2 hours ago | parent [-]

X servers are available for phones, Windows, and macOS. X interfaces not designed for phones can be difficult to use on phones. But web interfaces not designed for phones can be difficult to use on phones.

There is not a web tool for every use. And web tools are not better for every use.

tracker1 5 hours ago | parent | prev [-]

IIRC, it's not that secure though.. I'm really surprised people didn't do more things like send animated skulls to people's desktops.

wolvoleo an hour ago | parent | next [-]

Ps: oh yes and before '93 I've had so much fun practical joking around :)

wolvoleo 5 hours ago | parent | prev [-]

Xauth fixed that way back in '93. All you have to do is use -Y not -X with SSH.

throwawaymobule 3 hours ago | parent | prev [-]

Waypipe looks interesting.

The main advantage of x forwarding for me was when I'd randomly need it and had nothing set up ahead of time. Hopefully it starts getting installed in distros by default eventually.

marxisttemp 7 hours ago | parent | prev [-]

I'd rather use a TUI than a web UI.