Just discovered Mosh, it's pretty badass. I set it up on my home file server and my Nexus yesterday, and I've still got that first terminal session I opened running smoothly and ready to go in the background on my phone. It renders the terminal client on the server, then sends screen updates to your device. Input is echoed locally instantly and sent in the background and if there's a network interruption it'll highlight the text that hasn't been confirmed yet and seamlessly reestablishes connection to your session when connectivity returns. Handles client IP changes fine as well - I've had this session started on home WiFi, roamed to LTE, back to my work WiFi.. Pretty awesome.