Just a small addition for those using Fish shell
~/.config/fish/config.fish
if status is-interactive and not set -q TMUX tmux a || tmux end