Tmux is one of the most useful tool when it comes to using using a linux terminal.
Tmux is a terminal multiplexer, it allows a user to access multiple terminals (or windows), each running a separate program, while providing a single screen to work on. Tmux is useful for running more than one command-line program at the same time, increasing productivity and the way you work.
Close current Tmux Window
Let's consider the case where you are inside a tmux window i.e., your cursor is active in a pane in the window you wish to close.
You can use the following keyboard shortcut to close a window-
Prefix + &
By default the prefix is
Ctrl-B, so to close a tmux window you can run the following command-
Ctrl-B + &
Close Tmux Window using kill-window command
You can use the
kill-window command to kill or close the current tmux window-
$ tmux kill-window
Kill Tmux window by its position
It is possible to kill a target window from outside the current window by its index or position
$ tmux kill-window -t2
I hope you found this article useful, glad that you found it easy to close window in Tmux. You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.