How to detach from a tmux session

Detach — the session keeps running in the background:

keysprefix + d

Detach is not quit

Your programs keep running after you detach; closing your terminal or dropping an SSH connection has the same effect (an implicit detach). The session only ends when its last window closes or you kill it. This is the core tmux mental model: the server holds your sessions, terminals merely attach to them.

Detaching other clients

tmux attach -d detaches everyone else when you attach. prefix D lets you pick a specific client to kick — useful when a dead connection is holding your window size hostage.

Related

Verified against tmux 3.6 · updated July 2026 · back to the full cheat sheet