Hacker News new | ask | show | jobs
by 8fingerlouie 2808 days ago
I don't think i've missed anything, it does the same thing as ssh -L with slightly different syntax.

It's the same with mosh. Normally i use tmux on the destination host, and i simply cannot see any reason to use mosh over ssh/tmux.

1 comments

> i simply cannot see any reason to use mosh over ssh/tmux.

How about automatic session resumption and predictive character insertion to improve typing when under latency?

Since mosh relies on UDP, it's completely useless for folks who are behind proxies (e.g. for work, school, etc)
session resumption:

    tmux a
As for predictive character insertion, when i'm working in a shell, especially with high latency, i prefer my commands to be as i type them, not something some algorithm "guessed" i was going to type.
That's not what mosh is, it doesn't predict what you're going to type. It however proactively renders the characters you type before it receives confirmation from the tty on the other end.

In other words, imagine typing ssh somebox.typo.com and waiting 1 second before the text renders and discovering the typo, then pressing backspace, waiting a while for the backspaces to render, then going through all of this again. With mosh you'll be able to instantly see what you typed and fix it. On high latency connections it makes a huge difference in quality of life.

> It however proactively renders the characters you type before it receives confirmation from the tty on the other end.

Basically for those with experience of text terminals genrally: local echo.

I worked as a sysadm at at "large" (local scale) UNIX SysV installation back in the early 90s.

Everything there connected via serial ports, remote offices got multiplexed over a 9600 baud connection. Back then we had local echo for the sometimes slow link, i.e. printing a spreadsheet converted to 3Mb PostScript, and still only 9600 baud in total.

So i know what local echo is. It has nothing to do with prediction :)

I'm still not convinced about mosh, but it sounds like it really does help a lot of people, so who am i to judge. I guess i'm privileged since i don't usually experience latency. We have about 95% 4G coverage in this country, coupled with fiber connections.

The last time i experienced any noticeable latency was when editing files on a clients SCO OpenServer across The Atlantic Ocean over a 1200 baud connection.

> So i know what local echo is. It has nothing to do with prediction :)

Not precisely, because you're sometimes predicting whether a keypress should be rendered as a letter on the screen or not (e.g. if you click 'j' in vim command mode it doesn't actually print j). mosh, at least from my experimentation, seems smart enough to do that reliably.

You are privileged! It is a daily part of life in South Africa -- around 200ms to the EU and more for anywhere else. That kind of delay becomes extremely jarring when you are working on a VPS or doing anything, really. Local VPSs are expensive and just not on par with something like DO. I believe there's a great opportunity for opening up a DO-like service in JHB with VPS @ R70/mo.

We also never have enough players for the latest FPS games that require low latency :(

For me, the advantage of mosh is that it handles network changes seamlessly.
Mosh support roaming and intermittent connectivity which is really super useful if you have to debug a server on a very dodgy 3g connection in a moving train.
I just learned about mosh, ty. I use SSH sessions all the time and sometimes over satellite links.
You should run tmux or screen inside it anyway. There's no way to reattach to a broken mosh session, as happens if you close the local terminal.
tmux solves the session resumption at a lower level. You can have a connection from home, jump on a train, open your laptop and keep typing and do the same when you get into the office. You don't need to re-auth each time (or deal with delayed disconnects).

It works well WITH tmux, not instead of tmux.

Which means your solution would be something like:

  while true; do
    ssh -t ${HOST} tmux a
  done
But that lacks the other benefits, especially having to wait for the session to timeout.. Take a look at: https://en.wikipedia.org/wiki/Mosh_(software)#Performance
It doesn't guess. It sinoly has local echo, and the characters that are not-yet-ack'd are underlined. Changes your life when working with 175ms+ latency