Detaching from and attaching to Tmux Session

Detaching from Tmux Session
You can detach from the Tmux session and return to your normal shell by typing:

Ctrl+b d

The program running in the Tmux session will continue to run after you detach from the session.


Re-attaching to Tmux Session
To attach to a session first, you need to find the name of the session. To get a list of the currently running sessions type:

tmux ls

The name of the session is the first column of the output.

0: 1 windows (created Wed Nov  6 11:19:45 2019) [172x37]

For example, to attach to session 0, you would type:

tmux attach-session -t 0

Comments