Reputation: 53
I've been through the subreddit and the SO tag as well as a couple of pages of multiple phrasings of a Google search, and I can't find any threads/topics/pages that address this, so here goes:
I want the prefix key in tmux to always 'activate' the prefix in tmux. Let me explain what I mean - from the man page:
tmux may be controlled from an attached client by using a key combination of a prefix key, `C-b' (Ctrl-b) by default, followed by a command key. The default command key bindings are:
C-b
Send the prefix key (C-b) through to the application.
I don't have 'send-prefix' in my tmux.conf set to send the prefix combination to the application when pressed twice, but the result seems to be that the prefix now acts as a 'toggle'. Press it once, and the next key is interpreted as a command. Press it twice and the next key is sent directly to the application. For example:
C-b, C-Up results in my pane being resized up by one cell, but
C-b, C-b, C-Up results in ctrl + up being sent to my terminal window.
I would like to make it so regardless of how many times the prefix is pressed, the next key pressed is always interpreted as a command (i.e. the two keystroke sequences above to give the same result).
Thanks in advance!
Upvotes: 2
Views: 730
Reputation: 531858
This should do the trick:
bind-key C-b switch-client -Tprefix
It makes more sense if you think of the prefix not as a special key, but simply one bound in the root
table that also calls switch-client -T
:
# Equivalent to 'set-option -g prefix C-b'?
bind-key -Troot C-b switch-client -Tprefix
Upvotes: 1