How to change Tmux session list shortcuts?

Viewed 300

Since many years, I use Tmux for personnal and professional work. I specialy love the session tool, I a swith a lot beetween sessions thanks to the session list (Prefix + s). My problem is that the shortcut for switch sessions change beetween the 2.3 tmux version and the 2.8 (I use a lot the 2.3). For exemple : In the 2.3 version :

...
(9) + 9_others: 2 windows   
(a) + a_dev: 7 windows
(b) + b_srpc: 5 windows
...

In the 2.8 version :

...
(9)   + 9_others: 2 windows
(M-a) + a_dev: 7 windows
(M-b) + b_srpc: 5 windows
...

In the 2.3 version I can just use the "a" key to switch to the "a" session, but now I have to use "alt-a" to switch to the "a" version, and it is very disturbing.

Can someone knows how to change this shortcut ?

Thank's a lot.

1 Answers

They were changed so the keys can be used for other things in the various choose modes, which are now much more powerful.

If your tmux is new enough (I'm not sure 2.8 is), you can change them by doing something like this:

bind -n a if -F '#{==:tree-mode,#{pane_mode}}' 'send M-a' 'send a'

And the same for b, c, d and so on.

Personally I would just get used to using M-a, M-b and so on...

Related