If you are a regular user of tmux on the shell, I ‘m sure you been at the following point before as well:
I have logged into a remote host over ssh and started a long running command. I usually start a remote tmux session first, so I can close my notebook and cut the connection at any time if necessary. No harm done, the long running command continues running and I can come back to it at any time by attaching to the remote tmux session again. Every now and then, however, I forget to start tmux before that long running command, so I’m stuck and can’t close the notebook if I want the command to continue running on the remote host.
When this happened to me again recently, I wondered if I could move this ssh session to a new tmux session while the long running command is already active. And it turns out that this is actually possible!
Continue reading Moving an SSH Session to TMUX


