Unifying window modes and key bindings/commands

6 views
Skip to first unread message

Dane Jensen

unread,
Feb 14, 2026, 12:38:25 AM (12 days ago) Feb 14
to tmux-users
Hi! I was wondering if it would be desirable to move how keybinds/commands are handled in most of the different window modes. All but two have a callback which manually checks the input and performs the action inline, while the copy modes fetch their key table and have their commands registered as keybinds. I was thinking of moving all the modes away from the inline method and to the keytable style of handling input and commands. It would unify the methodology, expose all keybinds and their tables to the list-keys command, and possibly open up more scripting capabilities as users could have access to the converted commands. 

I wanted to check if this sort of refactor would be wanted before I started chipping away at it. I am more than happy to start if it is!

Nicholas Marriott

unread,
Feb 14, 2026, 12:47:58 AM (12 days ago) Feb 14
to Dane Jensen, tmux-users
I don't know... it used to work a bit like this with special non-command key tables for each mode but I changed it years ago when modes were revamped because it was a lot of complexity for something that hardly anyone wants to change (except for copy mode and the shortcut keys in choose mode, which you can already change).



On Sat, 14 Feb 2026, 05:38 Dane Jensen, <dhcj...@gmail.com> wrote:
Hi! I was wondering if it would be desirable to move how keybinds/commands are handled in most of the different window modes. All but two have a callback which manually checks the input and performs the action inline, while the copy modes fetch their key table and have their commands registered as keybinds. I was thinking of moving all the modes away from the inline method and to the keytable style of handling input and commands. It would unify the methodology, expose all keybinds and their tables to the list-keys command, and possibly open up more scripting capabilities as users could have access to the converted commands. 

I wanted to check if this sort of refactor would be wanted before I started chipping away at it. I am more than happy to start if it is!

--
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, visit https://groups.google.com/d/msgid/tmux-users/0e559159-a9f3-4473-993f-08227e5f9f71n%40googlegroups.com.

Dane Jensen

unread,
Feb 14, 2026, 12:59:17 AM (12 days ago) Feb 14
to tmux-users
Totally fair. I started looking into it when i saw the entry in suggested contributions: (#4357) Make ? or h display key bindings in choose modes. Moving  mode trees over to commands would give easy access to the keybinds via list-keys. I then saw all the different modes. If refactoring for just mode-trees is a maintainable solution, I can work on that, otherwise I will look for other other contribution suggestions!

Nicholas Marriott

unread,
Feb 14, 2026, 1:12:01 AM (12 days ago) Feb 14
to Dane Jensen, tmux-users
There is some work on that one here (look at my diff in one of the later comments), although it is not quite finished and I'm not sure what the status is:


I'm not completely opposed I'm just not sure there is enough demand for fully customizable key bindings in modes to make it worth it and the fact that there have been very few requests to change the keys beyond adding the odd missing vi mapping for editing seems to bear that out. From a UI design POV it is better for us if we can set fixed keys rather than having to map everything through key tables.

A vaguely semi-related problem to solve might be to try and come up with a way to make the default menus easier to edit without rebinding the whole key binding  People do want to change them occasionally and it is a pain having to copy the whole menu. I don't really have any ideas how that would look though.

Or customize mode could maybe do with some work, although I don't know if anyone really uses it.

There is other stuff on the todo list as well...

Thanks




Dane Jensen

unread,
Feb 14, 2026, 3:55:50 AM (12 days ago) Feb 14
to tmux-users
I did see that, though I wanted to check if this solution was preferred as it hooks into list-keys. I also don't know the etiquette around others PRs, so I'll leave that to him. I don't want to step on anyone's toes.

I'll investigate what you have suggested and the rest of the todo list to find something. Thanks for the consideration!
Reply all
Reply to author
Forward
0 new messages