11 ms·
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 y
by kbumsik 7y ago
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 favorite portable terminal machine.
[1] https://blink.sh/ https://blink.sh/
- jefftk 7y ago(author) I was already using tmux for session persistence, so the local echo and handling of congested networks were the two features that made me wish I'd switched to mosh earlier.
- AdamGibbins 7y agomosh does persistence better, if you're connected to tmux over SSH it'll still disconnect as your IP changes on a roaming connection (like it does on my daily commute on the train). mosh does not, it stays no matter what. Also no need for autossh or similar to reconnect when you unsuspend your computer.
- twic 7y agoIt's even useful for desktop users if you are hopping off and on a VPN.
- oefrha 7y agoOf 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.)
- kbumsik 7y agoYeah, Blinks doesn't handle the scrollback problem neither. I always use a bluetooth keyboard when I connect the shell so I launch tmux inside of it, so I use tmux's scrollback feature. Besides I don't much need scrollback when I use iPad anyway. I have to admit that terminal is inherently not suited for touchscreen. Here I am suggesting iPad Pro a laptop alternative for a dedicated terminal use, where you use a physical keyboard.
- oefrha 7y agoI sometimes use Prompt with the on-screen keyboard when I'm working out on a treadmill. It's neither pleasant nor productive, but it's okay. Btw, tmux scrollback sucks except when the terminal emulator's native scrollback is supported through control mode.
- carloscabanero 7y agoMay I ask, why do you keep using Prompt? Full disclosure, I’m one of Blink Shell devs.
- oefrha 7y agoNo particular reason, I picked it at first (when the iPad Pro 12.9'' came out in 2018, which incidentally was my first iPad) and it's been working okay for me, so not much of an incentive to shell out $20 for another terminal emulator. Also Panic is one of the more trustworthy shops out there (one of the reasons I picked it at first).
- carloscabanero 7y agoFair enough, thanks!
- Dylan16807 7y agoBut if you're running tmux then the "never get disconnected or lose terminal sessions" of mosh goes from major feature to minor feature.
- bpizzi 7y ago> 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 justifying changing the whole paradigm. Plus you get the additional bonus with tmux to be able to recover the same remote terminal sessions when switching computers (leave stuff in place at work, go home, continue on the same stuff at home). Edit: maybe it's the time for jumping ships!
- kbumsik 7y agoWell, just run tmux with Mosh. It gets even better.
- rmetzler 7y agoExactly. Close the laptop, connect to another network... as soon as you connect the network again you’re still on the server and your long running process still runs there.
- tyingq 7y agoDoes the keepalive functionality in ssh help here? Like: ssh -o ServerAliveInterval=5 -o ServerAliveCountMax=1 $HOST
- kstrauser 7y agoThere’s one place where it doesn’t (and can’t) help at all: when your address is changing frequently. Suppose I’m doing some remote debugging stuff on my way to work. I have one IP on my home Wi-Fi. As I walk to my bus stop, it switches to LTE. As my bus drives through the city, I periodically jump to different addresses. I grab a coffee on my walk to the office and end up on the coffee shop’s Wi-Fi with their address. I leave and hop back to LTE, until I get to work and connect to its Wi-Fi. With SSH, every one of those changes means reconnecting. With Mosh, it means that everything pauses for an instant and then resumes as if nothing ever happened.
- plg 7y agoDoes mosh play well with MacOS?
- na85 7y agoYes. I run a small Ultima Online custom server and it runs on a Debian box in a datacenter. My primary development machine is my macbook, and mosh-ing to my server is flawless, even from congested coffee shop wifi. The best part is I can use juicessh to mosh in from my phone if I need/want to as well!