Is there a tmux shortcut to create a new session?

Viewed 957

Just like leader_key + C creates a new window inside a session. Is there a similar shortcut for creating a new session ? Currently, I use leader_key + new

2 Answers

Why not just create a keybinding for that in your .tmux.conf?

These two settings let you create/kill a new session when pressing Prefix Shift+s or Prefix Shift+K respectively:

bind S command-prompt -p "New Session:" "new-session -A -s '%%'"
bind K confirm kill-session

Prefix Shift+s will open a command prompt in the status line, asking for a new session name. It will either create a new session with that name or attach to an already existing session by that name.

There are no predefined shortcuts, the only native way to do it is :

  • Create session: tmux new -s session_name

  • Ctrl-B + d to detach

  • Return to your session: tmux attach-session -t session_name

Related