Wait... what? That's the whole point of tmux. As far as I know there's no such thing as 'saving'. They're automatically saved. Unless you're on a shared computer? If so... here's a solution I wrote up a while ago:
--- title: Tmux on a shared server ---
Normally, tmux stores its session sockets in the /tmp directory. This is bad news when trying to run tmux on a shared computer (e.g. shared compute nodes) since the tmp directory is probably cleared on every login. To get around this tmux offers a way to store session sockets in alternative locations. How to use this isn't entirely clear in the man page though, so I'll outline it here. First, I'll create a directory to store the socket with ``mkdir ~/.tmux.socket'`{.bash}. Tmux stores new session sockets in the tmp directory so we must change that when we start tmux:
TMPDIR=~/.tmux.socket tmux
and to attach to this socket we use the `-S`{.bash} option and glob to
the socket (defaulted to be named `default`{.bash}) tmux -S ~/.tmux.socket/*/default attach
Here are some aliases to put into your shell config file to help: alias tmux-start="TMPDIR=~/.tmux.socket tmux"
alias tmux-attach="tmux -S ~/.tmux.socket/*/default attach"