I’ve taken to using github.com/neurosnap/zmx for session persistence for exactly that reason. There is a fork which uses the network plumbing smarts from mosh, but I haven’t tried it.
github.com
GitHub - neurosnap/zmx: Session attach/detach for the terminal
Session attach/detach for the terminal. Contribute to neurosnap/zmx development by creating an account on GitHub.