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..

  • what's wrong with mosh? I've been using it for a while and have successfully had sessions that lasted for weeks. – skarface Sep 15 '13 at 12:58
  • It sounds like tmux, screen or byobi are just what you need. If you don't want all of those other features...don't use them. I don't know what annoying term effects you're seeing, but spend 30 minutes to fix them and then you have the exact right tool for the job. IMHO, YMMV. – Joe Casadonte Sep 15 '13 at 21:02
  • Mosh requires that I open an ssh connection in reverse. This isn't always practical or allowed. Tmux/Screen attempt to manage the terminal for you so you can't use standard scrollback to see what happened. Look at all the hacks for apps like less that try not to pollute the term history after they quit...none of them really work well in all cases. I want my damn scrollbar on the CLIENT system to work I don't want the SERVER taking over the terminal responsibilities of the client. The server should be as dumb as possible – Peter Gerdes Sep 19 '13 at 10:19
  • I agree. The main shortcoming of multiplexers - for me - is dealing with the scrollback. Someday I'll probably commit to memory the scrollback keys in tmux, but it's a pseudo-scrollback by any definition, and it is an annoyance. I use tmux only when I need to start some long running task that I can't afford to have interrupted, and where I DGAS about the scrollback. I want to be able to swipe down (or spin a mouse wheel) to view my scrollback, not enter voodoo keystrokes (and I use emacs, so I'm comfortable with voodoo keystrokes). Unfortunately, I don't think there is such a beast. – anastrophe Sep 20 '13 at 23:51
  • @anastrophe, scrollback is invoked fine in tmux using the mouse, just have to configure it correctly (correct terminal and a single line in the config with a straightforward name). As a bonus you have your scrollback from anywhere you connect to the session. – unkulunkulu Apr 1 '15 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.