To exit tmux completely, you can use the command tmux kill-server
. To exit a specific session, use tmux kill-session
or type exit
in all panes. To temporarily detach without closing, press Ctrl+b d
.
$ tmux kill-server
There are multiple ways to exit tmux depending on what you want to accomplish: temporarily detaching from a session, closing a specific session, or shutting down the entire tmux server.
Ctrl+b d
- Detach from current sessionCtrl+b D
- Choose which client to detachtmux detach
- From command lineexit
or Ctrl+d
- Close current paneCtrl+b x
- Kill current pane (with confirmation)Ctrl+b &
- Kill current window (with confirmation)tmux kill-session
- Kill the current or last used sessiontmux kill-session -t session-name
- Kill a specific session by nametmux kill-session -a
- Kill all sessions except the current onetmux kill-session -a -t session-name
- Kill all sessions except the named onetmux kill-server
- Terminate the tmux server, closing all sessions Using tmux kill-server
will close ALL tmux sessions and any running processes within them. Make sure to save your work before using this command.
To skip the confirmation prompt when killing panes or windows, add these lines to your ~/.tmux.conf
:
bind-key x kill-pane bind-key & kill-window