Live data from Hacker News

Mosh

jefftk.com

11–20 of 152 posts

Re: Mosh

#11
post #5

Eternal Terminal ‘et’ is like Mosh but functionally better. Doesn’t break scrollback. Transparent to tmux control mode. I switched from Mosh to et across 12ish servers around 6 months ago and am way happier for it. https://eternalterminal.dev/ Previous conversation: https://news.ycombinator.com/item?id=21640200

Looking at Eternal Terminal, it doesn't have the same "local echo" feature that minimises the effect of latency in a cli environment.

Thats the trade-off. The "local echo" feature is what I use mosh for as I deal with system 8 to 10 timezones away. Doing this breaks scrollback.

I guess when mosh was first made, this was a problem with ssh shell sessions over EDGE or 3G as well, although network latency is less of a concern these days on 4G LTE or 5G mobile.

Re: Mosh

#12
post #5

Eternal Terminal ‘et’ is like Mosh but functionally better. Doesn’t break scrollback. Transparent to tmux control mode. I switched from Mosh to et across 12ish servers around 6 months ago and am way happier for it. https://eternalterminal.dev/ Previous conversation: https://news.ycombinator.com/item?id=21640200

Having extremely little knowledge of how these things work and thus a strong personal resistance to them (I only started using tmux recently, and exclusively with iTerm’s integration for its “control center” mode, just so I don’t lose sessions if my SSH disconnects), I’m seeing a lot of setup and caveats and am a bit scared off by these. This one looks nice because it has scrollback (essential) but it seems to require a bunch of installation on the remote? I have SSH on all my machines already; is there not something that can bootstrap a session from just that?

Re: Mosh

#13
post #2

I am also a fan of mosh. I really like that I can close my laptop and put it into standby, take it somewhere else with a different wifi network and just open it and get right back to work. From a user perspective it appears as if mosh was never disconnected.

You can use tmux for persistence like that, and I use mosh in combination with tmux just because it's so nice to get multiple windows and panes.

tmux solves a different problem - your session persists across disconnects, but you still have to reconnect and attach to the session manually.

mosh is for low bandwidth high latency but as a side effect it makes the reconnect step transparent most of the time.

(for the record i also use both mosh and tmux)

Re: Mosh

#14
post #5

Eternal Terminal ‘et’ is like Mosh but functionally better. Doesn’t break scrollback. Transparent to tmux control mode. I switched from Mosh to et across 12ish servers around 6 months ago and am way happier for it. https://eternalterminal.dev/ Previous conversation: https://news.ycombinator.com/item?id=21640200

ET uses a layer above TCP to make connections persistent, while mosh uses UDP which is better for high-latency or flaky connections (like 4G or wifi). For the use case in the original post with a congested wifi network, mosh is probably going to provide a better experience.

Re: Mosh

#15
post #5

Eternal Terminal ‘et’ is like Mosh but functionally better. Doesn’t break scrollback. Transparent to tmux control mode. I switched from Mosh to et across 12ish servers around 6 months ago and am way happier for it. https://eternalterminal.dev/ Previous conversation: https://news.ycombinator.com/item?id=21640200

ET has the somewhat undesirable characteristic that if you cat /dev/random or some other large file, you're going to have to kill the ET process if you want your terminal back. Mosh does not suffer from that

Re: Mosh

#16
post #5

Eternal Terminal ‘et’ is like Mosh but functionally better. Doesn’t break scrollback. Transparent to tmux control mode. I switched from Mosh to et across 12ish servers around 6 months ago and am way happier for it. https://eternalterminal.dev/ Previous conversation: https://news.ycombinator.com/item?id=21640200

Having extremely little knowledge of how these things work and thus a strong personal resistance to them (I only started using tmux recently, and exclusively with iTerm’s integration for its “control center” mode, just so I don’t lose sessions if my SSH disconnects), I’m seeing a lot of setup and caveats and am a bit scared off by these. This one looks nice because it has scrollback (essential) but it seems to requir…

There are moments that tmux's persist session won't work well such as opening nested SSH sessions to another machine with nested tmux to keep the session. Also, tmux does not handle SSH sessions, so if a SSH session disconnected (e.g. WiFi signal lost, your macBook gets sleep mode), you need to manually restart the SSH session and run tmux again, whereas Blink and ET never disconnects the SSH session.

On top of that, I use both tmux and Mosh at the same time. You don't need to use tmux exclusively.

I meant, you don't need to get scared. Both ET and Mosh built on top of SSH and there never be critical errors when dealing with their shell. Though both of them requires installations on the remote but they are a single zero-config packages: just install a package (not "a bunch of") and that's it. No config needed, even no background systemd services needed.

Re: Mosh

#17

I started using mosh a few weeks ago when I was working over ssh more. Even for working over LAN it was attractive because I'm really sensitive to typing latency. Don't be like the author and put off trying it, it's dead easy to install and try. No setup and no commitment to keep using it. However, I quickly ran into a problem which is that it breaks a scrollback. This is the one big problem with mosh and will probab…

Terminal emulators (xterm, iterm2 etc) are emulating something like a VT220 which were called "glass terminals" to differentiate them from earlier terminals which were keyboards attached to printers. So there's still this underlying concept of an endless spool of paper, and that's what you see when you scroll back. A scroll is literally a long piece of paper.

Anyway that means if you cat some long file and then hit control-c, whatever was output before you aborted still has to be sent to your terminal emulator so it can write it to this paper (save it to the scrollback buffer). This sucks on a slow connection. mosh is running the emulator on the remote side of the connection and the client that you're interacting with locally just syncs periodically to whatever is currently being shown on the screen. So it doesn't have to send all of the output, which as you've seen, does break local scrollback. But it's a great solution for the problem it was designed to solve which is making terminals work over slow and/or unreliable network connections.

If you pair it with gnu screen or tmux, then they become the terminal emulator and maintain the scrollback buffer, so you can still scroll back and see all of the paper. You just can't do it with the slider on your local window because your local emulator doesn't have access to the full contents of the buffer. I turn off scrollbars in rxvt and just rely on screen to maintain the buffer and use command keys to go back when I need to.

Re: Mosh

#18
post #5

Eternal Terminal ‘et’ is like Mosh but functionally better. Doesn’t break scrollback. Transparent to tmux control mode. I switched from Mosh to et across 12ish servers around 6 months ago and am way happier for it. https://eternalterminal.dev/ Previous conversation: https://news.ycombinator.com/item?id=21640200

This doesn't resolve the latency and reactivity problems that the author mentions though.

Re: Mosh

#19
Used mosh to access remote linux machines over a sub-GHz IPv6 mesh.

Since the mesh is UDP only, this provides a relatively normal shell experience for this type of situation.

Works well.

Re: Mosh

#20
post #8

The article misses the other great feature of Mosh: It never get disconnected, regardless of the client's state (IP address change, or device sleep mode), and you will never loose terminal sessions. When this is not so appealing to desktop users, it is a godsend feature for laptop/mobile users. Especially, if you are an iPad user you should try Blink shell app [1] with Mosh. This combination turns the iPad your favor…

Of course there’s also the big problem of lack of scroll back in mosh as mosh actually handles the terminal emulation. I suppose this would be especially bad on an iPad with an on-screen keyboard, as the number of lines would be severely limited. How does Blink handle this problem?

(I use Prompt 2 on my 12.9’’ iPad Pro which doesn’t support mosh. I only use mosh on computers with very high latency servers.)

Post reply on HN