I'd like to bind Ctrl-` in tmux to select-pane.
I've tried:
bind -n C-` select-pane -t :.+
Which gives me: unknown key C-`
I've also tried:
bind -n 'C-`' select-pane -t :.+
Which gives me the same error.
I then tried just plain `:
bind -n ` select-pane -t :.+
That worked fine (but bound ` not C-`.
Most confusingly, I tried:
bind -n `-C select-pane -t :.+
Which surprisingly worked (I had to hit backtick first, and then ctrl). What is it within Ctrl-` that tmux doesn't like?
Best Answer
tmux
uses this logic for handling the ctrl modifier inkey-string.c
(backtick is code 96):Although some applications may treat the whole range from 64 to 126 as valid for ctrl, tmux excludes backtic, curly braces, vertical bar and tilde. The likely reason is that they are less useful for key bindings because the unmodified keys are often used in shell scripts.
On the other hand,
ctrl-@
would have the same expected interpretation, and you could use that instead.