Skip to main content
Back to Commands
Session ManagementPrefix + d

detach-client

Short form: detach

Detach the current client or the client specified by -t from its session. The session continues running in the background.

Synopsis

bash
tmux detach-client [-aP] [-E shell-command] [-s target-session] [-t target-client]

Options

FlagDescription
-aDetach all clients except the one specified by -t
-PSend SIGHUP to parent process (usually the shell)
-t target-clientSpecify which client to detach
-s target-sessionDetach all clients from specified session

Examples

Detach current client

bash
tmux detach

Detach using keybinding (most common)

bash
Prefix + d

Detach all other clients

bash
tmux detach -a

Detach all clients from 'mysession'

bash
tmux detach -s mysession

Default Keybinding

Prefix + d

Default prefix is Ctrl+b

Pro Tips

  • Detaching keeps your session alive - you can reattach later
  • Use this before closing your SSH connection to keep work running
  • Prefix + d is the most common way to detach