Binding a command in tmux without using the prefix key

For your example, use:

bind-key -n C-1 select-pane -t 1

The -n argument is used to bind-key, it means no prefix.


I have a quibble with the accepted answer here.

According to tmux(1), -n is an alias for -T root. So including -n doesn't actually mean that there is "no prefix" as much as it means the command will be bound to the root table, which is "not recommended".

tmux(1):

The root table is used for keys pressed without the prefix key: binding ‘c’ to new-window in the root table (not recommended) means plain ‘c’ will create a new window

What this seems to be saying is that:

bind -n c new-window

Will create a new window when c is pressed, and indeed, it does.

The dry humor in the author's phrase "not recommended" is the fact that "c" will of course be pressed many times in the average tmux session, given that "c" is the third-most frequent letter in English.

For another example, here is fast tmux window switching (using PageUp/PageDown keys):

unbind NPage
unbind PPage
bind -n PPage previous-window
bind -n NPage next-window