Mosh Mobile Shell
64 comments
·August 28, 2025kenrose
jedberg
The killer use case was roaming IPs, but I'd say the killer use case today is battling latency. A lot more people are computing remotely now, even on their phones. Even with 5Guw, I still get bursts of crappy latency. And now some people are using 5G as their home internet.
It definitely solves problems when traveling and dealing with crappy airport/hotel/AirBnB/conference wifi that is slow or overloaded.
saghm
I used to use mosh when riding Amtrak and using the free wifi. Without it, I rarely could even stay connected long enough to run more than a command or two, but using mosh completely solved it. I had no idea people considered handling changes in the IP to be the primary use case.
slipperydippery
Even my home wifi sometimes has enough packet loss to kill SSH connections. And if my computer sleeps for a even a quarter-second, yeah, connection dead.
Mosh means a lot less, "Sigh..." up-arrow, enter. A small thing, but why live with it when you can just not?
zackangelo
I feel a bit silly for not noticing this before. Over the last year or so I've often wondered when ssh added protocol-level support for session resume. I'd open my laptop on a new network and everything would be ready to go. But of course, it's nothing to do with ssh, it's just that I started using tailscale.
0xCMP
And really they didn't even do anything special. This was a killer reason we loved Wireguard at our company and pitched heavily to keep it around to he company who acquired us and wanted us to switch to their VPN Appliance instead.
harrysungod
The main thing a big company IT admin wants is control over the users. At a previous company, they would ship really crappy software, by our own admission, to "enterprise" customers and all we had to do to keep them happy was to give a fancy control-panel that make then feel like king.
Yes, flattery works, pandering-to-ego works. Too bad, you can only push it so far...at some point, CTO/CEO notices.
whalesalad
You still need something like mosh if you are going to sleep your machine and expect to reopen an active ssh/tmux session remotely.
hnlmorg
That depends on:
1. whether your IP is persistent (ie you can reuse the same socket)
2. your SSH keep alive settings
3. and how quickly your OS can wake up it’s network stack
If the socket persists, then it should be possible to allow SSH to survive longer periods of network inactivity given the right keep alive settings.
When I used to work with on prem systems, I’d run non-standard ssh keep alive so I could bounce network switches without losing access to servers sat in between.
swinglock
It still improves the latency situation.
dunham
I tried mosh years ago, but ended up settling on "ShellFish" by the same guy who wrote "Working Copy". It can reconnect if you use a tmux session, and it has the ability to preview remote files and interact with the Files application on iOS (presenting the remote filesystem in Files).
0xCMP
I used to heavily use Blink Shell, but a combination of changes to their application and also that ShellFish + Tailscale is so easy and reliable made me switch entirely to ShellFish as well.
I also enjoy the ability to quickly launch/manage Digital Ocean instances useful sometimes as well.
watusername
mosh is neat, but I've mostly switched back to good'ol SSH over Tailscale due to various rendering bugs caused by client-server mismatches as well as the lack of port forwarding.
Basically mosh attempts to synchronize the state of the terminal which is made up of character cells. It sounds simple until you realize that unicode and fancy escape sequences exist, and the behavior of the client and the server must match otherwise you get weird misalignments that are difficult to debug:
- Unicode 9+ changed character width computation a lot, but macOS `wcwidth` still follows the old algorithm. Let's patch it: https://github.com/mobile-shell/mosh/pull/1289
- There is no support for strike-through and dimmed styles. Let's patch it: https://github.com/mobile-shell/mosh/pull/1059
- What about underline/undercurl? Let's patch it: https://github.com/jdrouhard/mosh/commit/aff5e1c3db9f061deb2...
- Some emojis don't take up two cells as expected? Again, let's patch it: https://github.com/jdrouhard/mosh/commit/b31161ab311c7b6e306...
- ...
You really need those patches to have a good experience, and popular mosh clients like Blink on iOS incorporate them in their builds. However, things look wonky if you don't use the corresponding server builds, and you don't want to dig through layers of abstractions to find out why selecting lines in a specific file in neovim causes everything to become a jumbled mess every so often.
There is no end in sight for those patched to be merged upstream, no end in sight for distros to ship new versions, and no end in sight for protocol changes to make state synchronization more resilient. So, back to SSH we go...
Edit: Fixed wrong link for underline/undercurl patch
craftkiller
I used to use this but ran into too many small issues that ended up outweighing the benefit compared to a plain-old ssh connection. Personally, I'm hoping for a QUIC-based alternative that reaps the benefits of being able to change IP addresses and recover from intermittent connection loss without any of the typing prediction stuff from mosh.
wavemode
What sorts of issues?
craftkiller
This is going back around 8 years so my memories aren't perfect and the issues could have been fixed by now. IIRC my biggest gripes were:
1. There was no scroll-back so you could only see 1 terminal screen of output. If you scrolled back, the text would be wrong or truncated or something like that. We would work around this by launching a tmux session and using that for scroll-back, but tmux scroll-back over a remote connection is so much clunkier than scrolling back in your local terminal emulator. If I'm already launching a tmux session, then I don't need mosh's ability to recover from broken connections because I can re-attach to tmux.
2. I found the typing prediction to be more annoying than it is worth. It worked great in bash but interactive apps (like those based on ncurses), the app would often end up a distorted mess until the round-trip to the server got back the real/correct rendering from the server. If I'm waiting for a round-trip from the server then I'm not getting any benefit from mosh's predictive typing.
3. It was only a remote terminal replacement. If you're doing anything more over ssh (port forwards, x11 forwarding, etc) then you're going to run into all the normal ssh issues anyway.
4. You had to run a 3rd party script to kill old abandoned mosh sessions. This is a consequence of being able to re-attach after a broken connection: the mosh server has no idea if you're coming back or not, so it leaves your session there. At least with tmux I can list the active sessions, re-attach to them, see what they're doing, and destroy them at will. With mosh, you could only reconnect to an old session if you hadn't closed mosh on your laptop. If your laptop powered off (intentionally or not) then you could either play "guess which mosh pid to kill" or leave your mosh session running long enough for the mosh killer script to get it.
Also there was the issue of popularity/network effects. ssh is everywhere, mosh is not, and its hard to argue that mosh should be everywhere when I was getting only slight benefit from it. This isn't mosh's fault, any ssh competitor that isn't upstreamed into openssh is going to run into the same exact problem.
With my hypothetical ssh-over-QUIC I'm hoping for just plain-old ssh with all the normal features, just using QUIC instead of TCP. Ideally upstreaming into openssh. I know there are a bunch of projects out there attempting something like ssh-over-QUIC but I think it has to be upstreamed and a drop-in replacement to overcome the popularity moat regular ssh has built.
davidb_
Great list that sparked my memory. The tmux scroll back issue was very frustrating for me, and ultimately what made me stop using it. What got me hooked on trying to use it - I do remember being amazed I could close my laptop, go home, and just reopen my laptop and immediately start typing away on my remote terminal without issue most of the time.
A few other issues I do remember running into (probably 10 years ago?):
1. Because it was udp, sometimes a captive portal, work, or hotel firewall blocked it.
2. It was also not installed by default anywhere, so sometimes sysadmins at work were unwilling to install it for me.
3. I sometimes ran into issues with color handling and utf8. I honestly don't remember if it was mosh or my terminal, though. It seemed to happen more often when I used mosh, but I could be misremembering.
rurban
For the missing scrollback feature, there is a patch in some forks. There is also C port somewhere.
esseph
Pls don't take away arguably the best feature! :-)
saidinesh5
These days i quite like using shpool: https://github.com/shell-pool/shpool
I used to use mosh, tmux before but always got annoyed how they broke scrolling , searching etc.. Especially when yakuake already provides half the functionality i used to rely on tmux for..
p0deje
It's a great project. I remember years ago, I suffered from intermittent SSH issues when using Vagrant with AWS, and I ended up writing a plugin[1] to replace `vagrant ssh` with `vagrant mosh`, which fixed most of my disconnects. It's a pity Mosh is not supported widely!
just_human
Hey all, I’ve been working on an open source rust-based alternative to mosh that solves some of the key issues like scroll back and using WebRTC instead of bootstrapping udp over ssh (which doesn’t work on firewalled networks). Would love any feedback on which features you’d like to see!
ChocolateGod
> Would love any feedback on which features you’d like to see!
Not leaving pull requests for over half a decade fixing critical issues with not even bothering to comment on them would probably be a massive advantage over Mosh.
just_human
Hah, I’ll aspire to do better!
newman314
Do you have a link to a GitHub repo for this? Also, will it be mosh compatible?
just_human
Not yet, but hope to have something up in September! It’s unfortunately not most compatible - I thought about that but didn’t see a lot of value and there were some downsides like re-implementing an encryption layer that doesn’t make sense if you use WebRTC. Just curious, what’s your use case for mosh compatibility?
pilooch
Hello, very interested in the scrollback! I've used mosh for 10+ years and it still runs my 100+ opened terminals to this day ! Would love to try your alternative
just_human
Awesome! I’ll post it to HN once I have the repo up and the code is in a halfway decent state. Look forward to your feedback!
psanford
I found the "lets pretend like there is no input latency" thing to be more distracting than useful. As soon as something does not work as expected the illusion is broken. It made me more grumpy than not having it on in the first place.
hosh
I had the opposite experience. I have worked remotely without mosh. The choppiness of responses was more distracting than pretending that the network will always be reliable.
Garlef
Funny sidenote: The mobile client for "Magic: the Gathering - Arena" does not even support "roaming" for your phones connection: If you for example turn off wifi during a match, it looses (and can not reestablish) the full connection even though your phone easily switches to mobile data.
geoffeg
Last commit to master was over two years ago, has mosh been replaced by something else or is the project just "complete"?
Kilenaitor
I have replaced it with Eternal Terminal: https://github.com/MisterTea/EternalTerminal
But I don't know how widespread that is.
silverlake
I used ET but it requires a server process also. Some machines are too locked down to allow this. Wish there was a way to kick start the server on demand.
mbirth
Uh, mosh needs to be installed to the server as well?
kstrauser
Same here. I tried a while back and nearly immediate switched over to using it over Mosh, for the same reasons you gave.
sangeeth96
Can you tell us why you made the switch?
Kilenaitor
Sure. I guess caveat I haven't used Mosh in a while, so maybe things have changed.
Mosh paints the screen, meaning no native scrollback. You have to use a multiplexer like tmux to get it. But ET has native scrollback. This is the biggest one for me.
Couple years ago I was on a more limited network that constrained usage of UDP which Mosh uses. ET uses TCP.
Mosh buffers inputs locally first which gives it the appearance of low latency but that illusion breaks when there are network issues. I prefer ET, even tho it can appear slower, since network issues are more obvious and I can troubleshoot them. But on a good connection, they're indistinguishable to me.
Those are three. There may be more. Honestly they are probably still more or less interchangeable for most. No reason to switch if you love Mosh.
iberator
Why update if something is perfect? Like in the old days: final version :) wait for new one in few years :)
mqtx
I absolutely love mosh! I use mosh to connect to my tmux server at work, so I don't need to worry about connection drops. Once I was in Europe editing a file, then came home, connected to my work VPN, and was right back in the same vim session.
esseph
When doing sysadmin or neteng tasks in remote areas and sometimes on crappy lossy internet, I wish this was on every device. I haven't touched mosh in at least 10 years. JuiceSSH is still my go-to android ssh/mosh client.
When mosh came out back in 2013, it solved a pretty real problem of ssh crapping out when you changed networks (like moving from in-office to home). It solves it at the app layer and uses UDP and is designed to work in high loss / latency environments. Very cool.
At the same time, in recent years, I've found that ssh running on top of Wireguard / Tailscale is way more usable than 2013 days. Those latter tools address the roaming IP issues directly at the network layer.
So while there are still issues with ssh / TCP if you're on a really crappy network (heavy packet loss, satellite link, etc), those have been less common in my experience compared to IP changes.
The “killer use case” for Mosh feels a lot less killer now.