Endorsing Mosh

Tuesday, 31 Mar 2015

Chris Siebenmann is skeptical about Mosh, which spurred me to write down my own feelings about it:

I Mosh!

When I’m traveling, I generally go online through hotel and conference networks. They almost always exhibit precipitously fluctuating latencies and often-miserable throughput. Occasionally they have tragic levels of packet loss. Just using Screen/Tmux/dtach over a SSH connection (as a commenter on Chris’ entry suggested) doesn’t come close to cutting it, because SSH itself is utterly unusable under such circumstances. I’ve had situations where it took dozens of timeouts before any connection would succeed, only to drop within seconds. On such a network, UDP is of the essence to get even an inkling of a usable connection. And only protocol-integrated predictive terminal emulation (i.e. Mosh) allows making full use of the benefits that the application of UDP to this scenario permits. So if you have to operate in a miserable networking environment, Mosh is indispensable.

Then, I embark on the journey back, and I throw Mosh out of my setup the minute I step off my return flight (or whatever else I am travelling on). If I can afford not to use Mosh, if I have a network connection worth calling that (and that really doesn’t take a lot), then the way Mosh operates – built-in non-optional detaching, inability to support SSH’s various forms of forwarding, and server-side per-session dæmons that never go away on error conditions – is grating. I can’t stand using it when I’m back in my usual haunts where SSH works well.

So there you go. I’m very glad it exists, because when I need it, it’s a sanity lifeline. But it cannot do its job unseen, and you’re in a real bad place if you need it. So however grateful I may be, I much prefer to neither need nor use it.

If you think this sounds schizophrenic, that’s because it is. Indeed this is a strange endorsement, I realise that. But let me assure you: when I need Mosh, I am so happy it exists.