tmux Scripting, Formats, and Automation/Build a session in the background

Create a detached session before laying out windows.

Section: Repeatable workspaces

Build a session in the background

bash
bash
tmux new-session -d -s api -n editor
Explanation

Detached creation is the foundation for repeatable startup scripts.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Repeatable workspaces
Send a command into a pane
Programmatically run startup commands.
OpenIn sheetbashsame section
Focus a specific window
Choose the window users should see first.
OpenIn sheetbashsame section
Attach after setup
Open the session after all windows and panes are ready.
OpenIn sheetbashsame section
List windows with a custom format
Print a compact machine-friendly window summary.
OpenIn sheetbash1 tag match
List panes with path and command
Inspect pane metadata.
OpenIn sheetbash1 tag match
Print a format string
Evaluate a format without changing the UI.
OpenIn sheetbash1 tag match