Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Rebind a built-in menu to another key combination?

15 views
Skip to first unread message

int...@intelfx.name

unread,
Jul 31, 2024, 2:43:38 AM7/31/24
to tmux-...@googlegroups.com
Hi,

So in tmux there is a number of built-in menus that offer various
actions on a pane or window. The ones I know about are activatable with
a mouse right-click or Prefix+< / Prefix+>. As far as I can see, they
are implemented as built-in bindings that open-code the entire menu
definition as the rhs of the bind-key command.

Now, let's say I'm not satisfied with the default key assignment and
want to rebind those menus to some other key sequence. I see two ways
around it:

1. copy-paste the entire binding into my `.tmux.conf`, changing the lhs
to the key I want;
2. invoke an external script from `.tmux.conf`, which would run `tmux
list-keys -a <original lhs>`, substitute the lhs with the desired key
and eval the result as a tmux command.

The solution (1) has a downside of hard-coding the menu definition into
my .tmux.conf, which means that if the menu definition is ever changed
upstream, I won't get the updated one, and the solution (2) has a
downside of being non-idempotent (i.e. it will mess everything up if I
ever reload .tmux.conf) as well as a downside of being a giant hack.

What is the preferred way to do what I want? If there isn't one,
perhaps it could be considered an RFE to make one?

Thanks,

--
Ivan Shapovalov / intelfx /
signature.asc

Nicholas Marriott

unread,
Aug 4, 2024, 4:26:06 AM8/4/24
to int...@intelfx.name, tmux-...@googlegroups.com
There is no way to change these bindings without rebinding the entire key to your own menu.

I don't mind having a way to do it but I don't want a million options one for each menu option.


--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/c81c7f27d3d6771f0eb81abf7ace6d28ff580111.camel%40intelfx.name.
Reply all
Reply to author
Forward
0 new messages