Resume term after ssh disconnect without multiplexer (screen/tmux)


Screen and tmux (like emacs) are fancy feature rich terminal multiplexers designed to let you efficiently manage terminals as if it was 1985 but they just complicate the simple task of resuming an ssh session where you left off after switching networks etc..

I use tmux when I need it but usually I have no use for split panes, multiple windows, sessions etc… I certainly don't want the annoying effects of messing with terminal

All I want (and a half-dozen other people on this site who don't know enough to make it clear they don't want tmux) is a ssh wrapper/clone that continues to run after disconnect (reconnects on keystroke) and a sshd wrapper/clone that simply buffers all output on disconnect and streams it on reconnect.

The closest thing I have seen is Mosh but how is this hard? There has to be a unique id in every ssh connection (if nothing else use a hash of the session-key) and the tcp protocal means sshd/ssh (or kernel buffers they use) have to retain every un-acked packet sent before ssh/sshd decide the connection has timed out. After timeout sshd can simply save the contents of the un-acked packages and any new data sent to the term and stream to the client connecting with the appropriate id.

Is it plausible (or does such an option already exist) to add an option/wrapper with this behavior (however it is implemented) to ssh? Sure, it wouldn't handle fancy situations like a user resizing the term between timeout and reconnect but it would do the one thing everyone wants let me reconnect to a prior ssh session without messing up scroll back, history etc.. etc..

Related Question