Create new tmux session from inside a tmux session

前端 未结 6 730
挽巷
挽巷 2021-01-29 20:02

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

6条回答
  •  梦毁少年i
    2021-01-29 20:18

    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.

提交回复
热议问题