Difference between 'C-b d' and 'C-b D' in tmux

424 views Asked by At

Currently reading through this guide to get a good start on understanding tmux. However, I am confused about a particular aspect of tmux.In the section Session Handling, there seems to be a mention saying that:

To detach your current session use C-b d. You can also use C-b D to have tmux give you a choice which of your sessions you want to detach. This will detach your session but will leave you’re doing in that session running in the background.

Now I tried out both options. C-b d seems to work perfectly fine but it seems like C-b D just gives me an option of one session to dettach (no matter how many sessions are running). In which case, the question arises: What is the point of having a C-b d and a C-b D?

1

There are 1 answers

0
Kent On BEST ANSWER

The text you have referenced is wrong! The author was confused by tmux's session and client. Default prefix+d will detach current tmux client, not session! Read tmux man page, there is a section that explains clients and sessions.

If you want to play with it:

  • Start two terminal windows
  • In the first teminal window: tmux new-session -s "foo"
  • In the second terminal window: tmux attach
  • Now you have two tmux (clients), you can in either tmux do: prefix+D, tmux will ask you which client you want to detach.