Entering the mosh pit
Entering the mosh pit
Posted May 17, 2017 19:53 UTC (Wed) by cgull (guest, #115681)Parent article: Entering the mosh pit
Mosh is a virtual terminal emulator that runs on both server and client. It transmits terminal output from server to client by sending updates from a previous state of the terminal screen to a newer one. It fundamentally maintains a rectangle of character cells for you to look at, rather than sending the complete character stream to update a terminal emulator on the client. So an application can update the screen quickly between two client updates, and character output that would go into scrollback on a normal terminal is simply never sent by Mosh, only enough data to construct an accurate display as of the second update.
So that's the weakness and strength of Mosh-- you don't get the full stream of data that you would with SSH, but the state synchronization protocol allows Mosh to skip intermediate transmitted state and blithely function on astoundingly bad networks. The predictive local echo is also important here. I've used Mosh on wi-fi networks with 50% packet loss and it's been noticeable but entirely usable. (Of course, when a network is this bad, it's a pretty short and steep slope from there to a network that drops all packets. Not even Mosh can fix that.)