2

I am trying to use bind-key -T root C-: command-prompt, but it is not working.

However, bind-key -T root M-: command-prompt works.

How can I use Ctrl+:, in other words Ctrl+Shift+; as a keybinding in tmux?

2

The Shift key is not included as a default prefix key in tmux (see here).

However, there is a function called user-keys. With this setting, you can define a custom escape sequence and bind that in tmux.

To test an escape sequence in Bash (as default), press Ctrl + V followed by the key sequence you want to test - it will then print the escape sequence.

However, for my terminal I get no valid escape sequence for Ctrl + :, which may also be the case for you.

But as an example let's take Alt + Home on my keyboard, which produces the escape sequence ^[[1;3H (or \e[1;3H in tmux).

This could then be bound in tmux using:

set -s user-keys[0] "\e[1;3H"
bind -T root User0 command-prompt

I realize the above is only partly an answer, but however outlines an alternative method which can be used, if you can generate an escape sequence from a key combination.

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.