enter image description here

When I pressed Ctrl+b w, I saw the windows I used before. How could I delete all of them?


From the tmux man page:

  kill-window [-a] [-t target-window]
               (alias: killw)

         Kill the current window or the window at target-window, removing it 
         from any sessions to which it is linked.  The -a option kills all 
         but the window given with -t.

So, at your command prompt try:

$ tmux kill-window -a

If you have one window that you want to preserve include it as well:

$ tmux kill-window -a -t:<window number>
| improve this answer | |
  • Thanks... Actually, I tried man tmux and found the kill-widow command. However, maybe I did a typo, It did work at that time. This time it succeeds. – Edward Lin Aug 5 '18 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.