Live data from Hacker News

Mosh

jefftk.com

91–100 of 152 posts

Re: Mosh

#91
The problem with mosh from my perspective has always been this sentence in the blurb:

> This is accomplished using a new protocol called the State Synchronization Protocol, for which Mosh is the first application.

This protocol has never been documented, making it "only" rather than "first", and once again putting the world in the position of one particular implementation's foibles being the only "specification".

Re: Mosh

#92
post #46
post #21

Earlier quoted context omitted.

> 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. I almost switched to mosh in the past while searching for this kind of solution to short-living ssh connections. But I've finally never made the jump, re-launching ssh/tmux being four keystrokes only (up+enter x2). Not…

Does the keepalive functionality in ssh help here? Like: ssh -o ServerAliveInterval=5 -o ServerAliveCountMax=1 $HOST

Not really, one of the greatest things about mosh is it's ability to restore connections, even if you put your host to sleep, have a network outage, switch from wired to wireless, and the like. The connection just comes back like magic.

Re: Mosh

#93
post #58

Earlier quoted context omitted.

Why do you code on a remote server?

Pretty common for physics experiments. My computer has neither direct access to the data being collected, nor the processing power to deal with it. Sure, I could code locally, push to a repo, and then test remotely, but the additional turnaround would be obnoxious. Far easier to open up a terminal and run emacs remotely.

I am a former Emacs user and now a VSCode user. VSCode has great 'remote SSH' capability - running a whole session locally on a codebase that is remote. Everything works seamlessly - find in files, code navigation etc.

Re: Mosh

#94
post #58
post #53

As someone who codes on a remote server the whole day, mosh is absolutely necessary and it is fantastic Advantages: - you dont see any lag when you type, it is exactly as if you were on your local machine - when network disconnect, the terminal freeze and when network is up again, the terminal becomes interactive again preserving everything in between - connection is preserved as long as the terminal is open, so even…

Why do you code on a remote server?

mosh is very useful for intermittent connectivity. Anytime I had to rely on spotty 2G/3G/wifi, the usual workflow "work locally ; git push" failed, as it's TLS/TCP and not resumable. Had to autossh+rsync the diffs out onto a stable host in the cloud, and then essentially worked from there.

Also, I have a mosh client on my smartphone; setting up the dev environment there would be a bear. Essentially the mainframe model ;)

Re: Mosh

#95
post #29

Mosh is fantastic. And as an old-timer I am rather amused how some good ideas from a while back make its way into current hot tech again. After all, the IBM 3270 terminal was specifically designed to not transmit one character at a time. Thanks to this, a 1970s-era IBM 3033 mainframe fitted with only 16 MB of main memory was able to support up to 17,500 3270 terminals. (see https://en.wikipedia.org/wiki/IBM_3270 )

Terminals in mosh are still fundamentally character mode, though. That's a fairly inescapable part of the POSIX general terminal interface. A better analogue for something where there's a block-mode send of form data is, ironically, a WWW browser and WWW pages with forms.

Re: Mosh

#96
Mosh is awesome! I use it all the time to connect to servers over a slow and high latency satellite link. Highly recommend it for high latency connections.

Re: Mosh

#97
post #53

As someone who codes on a remote server the whole day, mosh is absolutely necessary and it is fantastic Advantages: - you dont see any lag when you type, it is exactly as if you were on your local machine - when network disconnect, the terminal freeze and when network is up again, the terminal becomes interactive again preserving everything in between - connection is preserved as long as the terminal is open, so even…

But you do see lag - if you have auto/tab-complete, history search, command suggestions, etc, those all will still lag because they are waiting for a response from the server. The lag that is eliminated is the local echo of characters as you type, as mosh is sending those asynchronously in the background. If you have fancy, more interactive prompt/cmdline on the remote server then you'll still see the issue. Ditto if…

But what’s the alternative? Local development with syncing back to a server?

The lag is something that I can deal with. For me, the killer feature is the automatic reconnects. I usually only use mosh when I’m traveling and at conferences. In that scenario, I’m either using my iPad (with keyboard) where the client might be killed anytime I switch apps or I’m using the conference WiFi, with is always spotty. In either case, using a mosh client makes me less likely to throw my laptop or iPad down in anger every 5 minutes.

Re: Mosh

#98
post #77

Earlier quoted context omitted.

If you're using emacs, you may be able to use Tramp to remotely access the file. It depends on how IDE-ish you've got your emacs set up. As long as you've got reasonable latency I find that much nicer. (If you already know, well, I'm sure someone else just learned something today.)

Oh absolutely. I like using tramp to edit individual config files remotely. If there is one particular data acquisition computer that is performing incorrectly, I can quickly open up that file to compare, without needing to leave the editor. The issue I ran into with editing code through tramp is the integration with make. I use `M-x compile` to compile from emacs, with a few modifications to find the appropriate mak…

If you are in a buffer for a remote file, then M-x compile should run make on the remote machine.

Docs are here: https://www.gnu.org/software/tramp/#index-compile

Re: Mosh

#99
post #24

Mosh’s non-support of scrollback was always a deal-breaker for me. iTerm2’s tmux integration is pretty nice, though. Apparently there is iTerm2+tmux+mosh dark magic if one is into that kind of thing: https://www.gaeblogx.com/2017/10/09/Remote-Shell-Session-Set...

Well, tmux supports scrollback with `prefix [`, then `j` and `k` and `C^u` and `C^d` to move up and down, Enter to select and copy text. Not good enough?

Re: Mosh

#100
post #93

Earlier quoted context omitted.

Pretty common for physics experiments. My computer has neither direct access to the data being collected, nor the processing power to deal with it. Sure, I could code locally, push to a repo, and then test remotely, but the additional turnaround would be obnoxious. Far easier to open up a terminal and run emacs remotely.

I am a former Emacs user and now a VSCode user. VSCode has great 'remote SSH' capability - running a whole session locally on a codebase that is remote. Everything works seamlessly - find in files, code navigation etc.

That doesnt answer why. I have a table saw that works really well, doesn't mean I use it all day every day.
Post reply on HN