Is there a way to check programatically that I have a tmux screen session running? I'd love to be able to write a script that checked for the presence of a tmux session and attach it, or if no session exists, start a new one. So that I could create a custom command in my .zshrc file, and not have to always check.

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

There is an answer over on StackOverflow http://stackoverflow.com/questions/3432536/tmux-create-session-if-none-exists

tmux attach || tmux new
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.