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
All the commands you can launch within your terminal, like tmux new -s sessionName
can be launched from within tmux
by pressing the trigger key (eg: ctrl-b
) then :
then the command without the starting tmux
part.
As a result, ctrl-b :
followed by new -s sessionName
will do exactly what you want and give a name to your session. It also switches automatically to the new session.