How do you detach from a tmux session?
Ctrl + B, D — Detach client
Press the prefix Ctrl + B, release it, then press D to detach. The session keeps running in the background; tmux attach reconnects to it from any terminal.
Related tmux shortcuts: Sessions
| Shortcut | Action | Notes |
|---|---|---|
| Ctrl + B, D | Detach client | Detach the current client, leaving the session running in the background. |
| Ctrl + B, $ | Rename session | Rename the current session. |
| Ctrl + B, S | Choose session | Select a new session for the attached client interactively. |
| Ctrl + B, ( | Previous session | Switch the attached client to the previous session. |
| Ctrl + B, ) | Next session | Switch the attached client to the next session. |
| Ctrl + B, Shift + L | Last session | Switch the attached client back to the last session (uppercase L). |
| Ctrl + B, Shift + D | Choose client to detach | Choose a client to detach (uppercase D). |
| Ctrl + B, Ctrl + Z | Suspend client | Suspend the tmux client. |
From the tmux reference (73 entries) · all how-to answers