-
Notifications
You must be signed in to change notification settings - Fork 132
fix: restore shift keybinds #394
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
Conversation
|
failing a bunch of tests 😅 not sure why edit: Guessing this is because the simulated inputs in tests are just uppercase and not shift prefixed. So, in other words, everything works in reality, tests are just failing because of mismatching inputs. |
|
Another approach to fix this issue could be to change keybind parsing to handle uppercase binds 🤔 |
|
Yea @mWalrus I think upper-case should work, perhaps Showing refs ( |
|
That's weird @altsem 🤔 I even checked back in the commit history just to make sure I wasn't going crazy, and it works for me on 0.33 release commit but not after you switched backends for Termwiz. Not sure what is going then... I've tried these keybind definitions:
And only the last one works for me (on Arch Linux (btw)). |
|
Ah, I discovered something @altsem! It works for me in the alacritty terminal, but not in the foot terminal. I wonder why that is... |
|
That's interesting. I installed Foot, but I can't reproduce it. |
|
I think I must've broken it with this change: |
Oh, uhm... that's weird indeed 😅 I figured out what's happening (on my machine at least).
While termwiz running in
I can "fix" the issue by modifying the key press in-flight: match event {
InputEvent::Key(ref mut key_event) if key_event.modifiers == Modifiers::SHIFT => {
if let KeyCode::Char(c) = key_event.key {
key_event.key = KeyCode::Char(c.to_ascii_uppercase());
key_event.modifiers = Modifiers::NONE;
}
}
_ => {}
}But maybe I should do more testing to see if I can figure out why it behaves differently in the first place. Maybe it's because of differences in input handling between Wayland compositors or something funky like that. |
Oh yeah, looks interesting! |
|
That fix does work in Foot for me, but breaks it in alacritty. Foot: Alacritty: |
|
Perhaps
|
|
Managed to implement a working fix. Should I close this PR and open a new one from that branch? |
|
@mWalrus I went ahead and did it, will take it for some testing and merge if all is fine. |
shift keybinds (like shift + Y to show refs) stopped working after 3cb28c6 and 5410015.
This PR fixes this. :)