SIGN IN SIGN UP

Allow keybindings to configure more than one key (#5634)

Keybindings in the user config file can now either be a single string as
before, or a list of strings, in which case the action can be triggered
by any of them.

This has two benefits:
- users can add alternatives that they want to use occasionally. One
example is the `<esc>` key: some users are used to typing it as `ctrl+[`
because this used to be possible in the legacy terminal protocol. With
recent changes to lazygit's keybinding system this no longer works out
of the box, since `<esc>` and `ctrl+[` are now distinct keys that can be
bound separately. But users who want the two to behave the same (as in
the old days) can now do
  ```yml
  keybinding:
    universal:
      return: [<esc>, "ctrl+["]
  ```
- we can get rid of all those `XyzAlt` bindings that we used to have,
for cases where we already wanted to have alternate keybindings by
default (for example `<up>`/`<down>` and `j`/`k` for going up and down
in a list). These can now be expressed a lot more elegantly, and require
less code.

The `XyzAlt` bindings are marked as deprecated but they are still
supported. We could instead have added a
migrator that changes users' config files and gets rid of the alt
configs for good already; I decided not to do that, because this would
render the config file invalid for older versions of lazygit, which
would then refuse to start; and that's annoying when bisecting bugs.
We'll keep the deprecated configs in the code for a year or so, and then
add the migrator.
S
Stefan Haller committed
c826811eaf36a98c3ccff95575c9d6e043bf3014
Committed by GitHub <noreply@github.com> on 5/25/2026, 1:49:46 PM