We have a tmux session that several people need to connect to. Some people like the Ctrl+a prefix shortcut and some people prefer the default Ctrl+b shortcut. Is there anything I can put in the .tmux.conf file to allow both shortcuts to work?
It seems that the standard
set -g prefix C-a
command will unset the Ctrl+b shortcut.
I have also tried this:
set -g prefix C-a set -g prefix C-b
but the second line then unsets the Ctrl+a
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
The above answer is correct for tmux 1.5 and earlier
However, this has changed in tmux 1.6. Now, there are two options, prefix, and prefix2, each of which can only be set to a single value, like this:
set-option -g prefix C-a set-option -g prefix2 C-b
Method 2
For releases prior to 2012: Issue the command only once, with all the desired prefix keys separated by commas:
set-option -g prefix C-a,C-b
For versions >= 1.6 (Released the day before your question, 23/01/2012) see the other answer.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0