tmux is a cool tool that allows you to have multiple screens within a single terminal and to have persistent SSH sessions. The documentation and most tutorials are horribly complex, but it’s actually not that hard to use the basic functionality.
Start a new session with:
Detach your session with:
Reattach your session after detaching or having your SSH session die:
tmux attach -d
If you’d like to use ssh key forwarding (i.e.
ssh -A) with tmux you’ll need to create a new session as opposed to attaching to an existing session.