Killing a tmux session removes a workspace that is no longer needed and stops every shell, editor, and job still running inside its windows and panes. It is the cleanup command used after work has been detached, finished, or moved to another session.

The kill-session command destroys one target session and detaches any clients attached to it, but it does not remove windows that are still linked to some other session. Using the session name with -t keeps the action narrow and makes the next tmux list-sessions check easy to read.

Because the command ends the processes inside the target session, the safe flow is to list the current sessions first, kill only the intended name, and verify what remains afterward. In the default tmux setup, removing the last session makes the server exit, so a follow-up list returns a no-server message instead of another session list.

Steps to kill a tmux session:

  1. List the current tmux sessions so the exact target name is visible before anything is removed.
    $ tmux list-sessions
    build: 1 windows (created Wed Apr 15 14:33:36 2026)
    ops: 1 windows (created Wed Apr 15 14:33:37 2026)

    The name before the colon is the -t target for kill-session.

  2. Kill the named session that should be removed.
    $ tmux kill-session -t build

    Every window, pane, and running process inside build ends immediately unless that window is also linked to another session.

  3. List the sessions again to confirm the removed name is gone and the remaining workspaces are still present.
    $ tmux list-sessions
    ops: 1 windows (created Wed Apr 15 14:33:37 2026)
  4. Keep one session and remove every other session when a broader cleanup should leave a single workspace running.
    $ tmux kill-session -a -t keep

    The -a flag kills all sessions except the target given with -t.

  5. Recheck the session list after the keep-one cleanup to confirm only the intended session remains.
    $ tmux list-sessions
    keep: 1 windows (created Wed Apr 15 14:33:38 2026)
  6. Correct the target name before retrying when tmux reports that the requested session does not exist.
    $ tmux kill-session -t missing
    can't find session: missing
  7. Expect the default tmux server to stop after the last session is removed and confirm that state with one more session list.
    $ tmux list-sessions
    no server running on /tmp/tmux-1000/default

    The numeric socket directory varies by user account, but the message itself is the normal sign that no tmux sessions remain.