The cursor blinked, alone, in a dead terminal.
I’d been cut off from a remote Emacs session one too many times. SSH dropped. VPN froze. Work paused, always at the wrong moment. Then I found the pairing that never lets go: Emacs over Mosh.
Mosh—Mobile Shell—keeps your connection alive even when networks drop or change. Move between Wi‑Fi, tethering, or bad coffee shop routers, and Mosh won’t blink. Pair that with Emacs, and you have something close to indestructible.
Why Emacs over Mosh is different
Regular SSH is fragile. Break the line and you start over. With Mosh, the session lives on the server. The client predicts and displays instantly, even while packets lag. Running Emacs inside Mosh feels like local speed with remote persistence. Scrolling, editing, and navigating buffers remain smooth, without the jitter or wait you know from weak links.
Mosh also encrypts traffic by default. Keys stay private. You skip the constant need for manual reconnects. No need to re-enter the editor; your exact state survives network chaos. For those who keep Emacs sessions running for days or weeks, this matters.
Setting it up
You need Mosh installed on both local and remote machines. On macOS: