I\'m writing a shell script that creates / attaches or switches to a given session, depending on whether one is inside tmux and the session exists.
I\'ve got everything
at user2354696's advice I use following key bindings to create a new session or "clone" an existing session
bind-key N run-shell 'TMUX= tmux new-session -d \; switch-client -n' bind-key C run-shell 'TMUX= tmux new-session -t $(tmux display-message -p #S) -s $(tmux display-message -p #S-clone) -d \; switch-client -n \; display-message "session #S cloned"'