23

When I press Ctrl+b, W, tmux shows the list of all current windows and their panes. How can I kill a window and its panes from within this list view?

0

2 Answers 2

32

This is a new capability of the choose-tree feature in tmux 2.8. From tmux(1):

Key   Function
Enter Choose selected item
Up    Select previous item
Down  Select next item
x     Kill selected item

So after you've navigated to the right window, press <tmux prefix> + x, then when you are prompted:

Kill window 1?

...press y to accept. This also works for killing individual panes, or even whole sessions.

2
  • is there a way to close without using the prompt? Commented Mar 2, 2023 at 15:59
  • 1
    @kendfss There's no way to bypass the prompt, according to the current source. But you could invoke choose-tree with a kill command in the template, ie. :choose-tree "kill-window -t %1", so it will immediately kill the one you choose (with Enter). Commented Mar 2, 2023 at 17:22
0

For anyone landing on this now. You can prefix + w to show the window list, then press x to close a window.
Tested on tmux 3.5a

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.