How do you detach from a tmux session?

tmux · Sessions · updated 2026-08-23

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

ShortcutActionNotes
Ctrl + B, DDetach clientDetach the current client, leaving the session running in the background.
Ctrl + B, $Rename sessionRename the current session.
Ctrl + B, SChoose sessionSelect a new session for the attached client interactively.
Ctrl + B, (Previous sessionSwitch the attached client to the previous session.
Ctrl + B, )Next sessionSwitch the attached client to the next session.
Ctrl + B, Shift + LLast sessionSwitch the attached client back to the last session (uppercase L).
Ctrl + B, Shift + DChoose client to detachChoose a client to detach (uppercase D).
Ctrl + B, Ctrl + ZSuspend clientSuspend the tmux client.

From the tmux reference (73 entries) · all how-to answers