23

I've looked through the man pages so this might be asking in vain. I get annoyed at the confirmation message for kill-window (Ctrl-b & or Ctrl-b kill-window on the default setup). This always gives:

Confirm 'kill-window'? (y/n)

Personally, I would essentially never hit Ctrl-b & unintentionally. Is there any way to disable this prompt, or prompts in general in tmux?

30

By default <Prefix> & is bound to confirm-before -p "kill-window #W? (y/n)" kill-window. The use of confirm-before causes the prompting. If you do not want the confirmation prompt, then just rebind & directly to kill-window:

bind-key & kill-window

You may also want to rebind x, too. It defaults to a confirming version of kill-pane; though you might want to consider whether this one might be too easy to accidentally type before removing the confirmation.

bind-key x kill-pane

Note: Both examples above are suitable for direct inclusion in .tmux.conf, but you could also type them into a <Prefix> : prompt, or type them into a shell after tmux (though you would have to quote/escape & since it usually special to the shell).

I think those are the only default bindings that use confirm-before. You can check your particular configuration like this:

tmux list-keys | grep confirm-before
| improve this answer | |
  • 2
    ... hallelujah! – Purrell Jan 29 '12 at 22:37
  • bind-key X kill-pane – suzanshakya Oct 25 '19 at 15:19

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.