Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keymapping rejected #2953

Open
Talkabout opened this issue Aug 21, 2023 · 5 comments
Open

Keymapping rejected #2953

Talkabout opened this issue Aug 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Talkabout
Copy link

Talkabout commented Aug 21, 2023

Describe the bug
After update to version 0.40.2 I am not able to map <c-h> key.

To Reproduce
Steps to reproduce the behavior:

  1. Map any function to <c-h> in config.yaml
  2. Open lazygit

Expected behavior
I'd like to be able to use this keybinding again

Screenshots
image

Version info:
commit=5e388e21c8ca6aa883dbcbe45c47f6fdd5116815, build date=2023-08-07T14:05:48Z, build source=binaryRelease, version=0.40.2, os=linux, arch=amd64, git version=2.39.2

@Talkabout Talkabout added the bug Something isn't working label Aug 21, 2023
@stefanhaller
Copy link
Collaborator

Which version of lazygit were you using before upgrading to 0.40.2? As far as I can see, it was never possible to map <c-h>. I tried 0.37, and got the same error message.

The reason is probably that for a terminal, <c-h> is indistinguishable from backspace.

@stefanhaller
Copy link
Collaborator

Oh wait, I'm stupid, I tested wrong. It was indeed possible to map <c-h> until v38.2.

Bisecting points at 2e66d87. I didn't investigate further whether or how it's possible to fix this.

@Talkabout
Copy link
Author

Hi @stefanhaller,
thanks for your investigation!
I guess the fix is not that difficult, this key combination needs to be added to the "allowed" list. It was removed during the commit you linked, but my assumption is that it was removed because it was not contained by the other list of keys that was "synced" in the mentioned change.

@stefanhaller
Copy link
Collaborator

No, it's not so simple. Adding <c-h> to this list doesn't work, it complains that the entry is already in the list (under the name of <backspace>, which is the same key).

But this shows us a workaround: in 0.38, mapping a command to <c-h> or to <backspace> achieved exactly the same thing. Mapping to <backspace> still works in 0.40.2, so just do that and you'll be able to type ctrl-H to perform your command.

Untangling this better requires deeper investigation that I don't have time for right now...

@Talkabout
Copy link
Author

Thank you @stefanhaller, the workaround works and I can live with it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants