How to close a pane in tmux
Exit the shell, or force-kill a stuck pane:
keysprefix + x (confirms with y/n)
exit vs. kill
A pane lives as long as the process inside it. Type exit or press Ctrl-d and the pane closes cleanly. prefix x (kill-pane) is for when the process is stuck. When the last pane in a window closes, the window closes; when the last window closes, the session ends.
Keep panes open after the command exits
If a pane closes before you can read the output, set -g remain-on-exit on keeps dead panes visible; restart the program in one with respawn-pane -k.
Related
Verified against tmux 3.6 · updated July 2026 · back to the full cheat sheet