5

I am running a server with Ubuntu 14.04 using nodejs with npm start command.
I start tmux session with tmux command, then do npm start and finally do ctrl+d to detach. But ctrl+d would not work for me. Whatever I am using, it only detaches me from the session if I stop all the processes. It is also same problem when I am trying to detach from session with mongod running. Any ideas?
PS: running ctrl+a+d does not work either.

pdoherty926
  • 9,895
  • 4
  • 37
  • 68
margarita
  • 884
  • 1
  • 10
  • 21

1 Answers1

8

When issuing a tmux command, you need to first use the prefix key combination. By default, this is C-b (ctrl+b).

If the default prefix isn't working, it's possible that you changed it or, if you're using someone else's .tmux.conf, they may have changed it. You can run tmux list-keys | grep send-prefix from your shell to determine what the current prefix is.

So, in order to detach from a running session, you'd type C-b d.

pdoherty926
  • 9,895
  • 4
  • 37
  • 68
  • Thank you! It really helped! – margarita Oct 18 '16 at 20:17
  • For anyone else finding this question having trouble detaching, even when using the correct command, try running `tmux kill-server`. I ran into an issue where a tmux session was running on a remote server, and every time I ssh'd in I would already be in a running session, and `C-b d` would not detach, very weird but that command fixed it. Credit: https://stackoverflow.com/questions/38295615/complete-tmux-reset – nameofname Mar 17 '23 at 04:00