To kill a tmux session, use tmux kill-session -t session-name from outside tmux, or Ctrl+b :kill-session from within a session.
$ tmux kill-session -t session-nameKilling tmux sessions allows you to close and clean up unwanted or stale sessions. This is different from detaching, as killing a session completely terminates all windows, panes, and processes running within that session.
tmux kill-session -t session-name - Kill by session nametmux kill-session -t 0 - Kill by session numberCtrl+b then type :kill-session and press EnterBefore killing a session, you may want to list all sessions to find the name or number:
$ tmux ls 0: 1 windows (created Fri May 31 12:34:56 2025) [80x24] dev: 2 windows (created Fri May 31 14:10:34 2025) [80x24]
tmux kill-server - Kills all sessions and the tmux serverkillall tmux - System command to terminate all tmux processesIf you're currently in a session you want to kill:
Ctrl+b to enter command mode:kill-session and press EnterKilling a session will terminate all processes running in it. Make sure to save your work before killing a session.
To kill all sessions except the current one, use tmux kill-session -a. To kill all except a specific session, use tmux kill-session -a -t session-name.