Does the keepalive functionality in ssh help here? Like:
ssh -o ServerAliveInterval=5 -o ServerAliveCountMax=1 $HOST
ssh -o ServerAliveInterval=5 -o ServerAliveCountMax=1 $HOST
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.