I use tmux quite a bit, especially on remote servers that I connect to via SSH. I can start a new tmux session by simply running tmux
, and I can re-connect to an existing session with tmux a
. But, if I run tmux a
, and I don't have a session running, it just says this:
$ tmux a
no sessions
That makes sense, as I don't have one running. Is there a way to detect if a session is running, and if there is one already running, connect to it, but if there isn't one running, start a new one?
Unlike this question, I don't care about session names as I don't use them