To close a tmux pane, press Ctrl+b
followed by x
. This will prompt for confirmation. Alternatively, you can type exit
or press Ctrl+d
in the pane you want to close.
There are multiple ways to close panes in tmux, depending on your preference and whether you want to be prompted for confirmation. When the last pane in a window is closed, the window will also close. Similarly, when the last window in a session is closed, the session will end.
Ctrl+b x
- Kill the current pane with confirmationCtrl+b :
then type kill-pane
- Kill current pane without confirmationCtrl+b :
then type kill-pane -t 2
- Kill pane number 2exit
- Type this command to close the current paneCtrl+d
- Send EOF (end-of-file), which typically closes the shell and the paneCtrl+b !
- Break pane into a new window (removes it from current window)Ctrl+b :
then type kill-pane -a
- Kill all panes except current oneCtrl+b &
- Kill the entire window (and all its panes) with confirmation If you accidentally closed a pane, you can respawn it with: Ctrl+b :
then type respawn-pane -k
To create a key binding that kills panes without confirmation, add this to your ~/.tmux.conf
:
bind-key X kill-pane
Then you can use Ctrl+b X
(capital X) to kill panes instantly.