How to detach from tmux sessions?

Quick Answer

To detach from a tmux session, press Ctrl+b followed by d.

Ctrl+b+d

Detailed Explanation

Detaching from a tmux session allows you to leave your session running in the background. This is one of tmux's most powerful features - you can disconnect from your terminal and reconnect later with all your windows and applications still running exactly as you left them.

Ways to detach from tmux:

  • Ctrl+b d - Standard detach command
  • Ctrl+b D - Choose which client to detach (if multiple are connected)
  • From command line: tmux detach

Reattaching to detached sessions:

  • tmux attach or tmux a - Attaches to the most recently used session
  • tmux attach -t session-name - Attach to specific session

Pro Tip

Use tmux ls to list all active sessions before reattaching.