exit tmux window without quitting the Terminal program

OK I’m new to this. I installed tmux to run a several days experiment. After typing tmux new -s name I got a new window with green banner at the bottom. I compile and run java program. Now I do not know how to exit the window (while leave it running). The bash (or whatever) cursor is not responding because the java program is still running. My solution so far is to quit the Terminal program completely and reopen it again. Any ideas on how to quit the tmux window without exiting the whole Terminal program?

Asked By: seteropere


Detach from currently attached session


Ctrl+ b d or Ctrl+ b :detach


Ctrl+ a Ctrl+ d or Ctrl+ a :detach

Answered By: Ruban Savvy

The previous answers are incomplete, I believe. What :detach does is to shut down the viewports that are displaying tmux activity. However, tmux itself is still running in the background as you can see by running ps:

myuser 1799 0.0 0.0 2500052 4632 ?? Ss 21Feb16 0:48.39 tmux new-session -s Dev

In fact, even if you quit terminal and start it up again, any tmux processes are STILL running in the background.

To actually kill the tmux process itself, you have to do:

tmux kill-session [-t session_name]

or simply:

kill -9 1799

Answered By: JESii
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.