Creating a tmux session gives you a persistent workspace that can keep shells, editors, and long-running commands alive even after you leave the terminal. It is the usual starting point when you want one named place to hold related tmux windows and panes.
The new-session command attaches to the new session by default, but -d creates it in the background so the current shell stays where it is. Giving the session a name with -s makes later attach, list, rename, and cleanup commands target the intended workspace instead of whichever session tmux would choose automatically.
Printing the new session with -P returns the created target name, and list-sessions confirms the same session with its window count and creation time. If the chosen name is already in use, tmux rejects the request so a second create command does not replace or disturb another running session.
Related: How to attach to a tmux session
Related: How to list tmux sessions
$ tmux new-session -d -s work -P work:
The -d flag keeps the current shell in place instead of attaching immediately, and omitting -d opens the new session in the current terminal. Add -c with a project directory when the first window should start somewhere other than the current directory.
$ tmux list-sessions work: 1 windows (created Fri Jun 5 07:50:35 2026)
Tmux shows the session name, window count, and creation time for each session it knows about.
$ tmux new-session -d -s work duplicate session: work
Session names must be unique on the same tmux server, so reuse a different name or attach to the existing session instead of trying to create it again.
Related: How to rename a tmux session
Related: How to kill a tmux session