-
Notifications
You must be signed in to change notification settings - Fork 281
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
Backspace with modifiers not recognised as backspace #504
Comments
I can not give you a definitive answer. Terminal input sequence codes are terrible to work with. Your language, key-board layout can play a role here. However, if you enable raw mode keep in mind any behavior like deleting the last word will not work anymore. It's your responsibility to get it to work. |
Yeah, of course, I implemented something that works on ctrl + backspace and it never receives any ctrl + backspace. That's some custom behavior I programmed, but it never gets to action since it never gets any ctrl + backspace. |
on Konsole, ctrl + backspace yields ^H (0x08), while on VSCode, ctrl + backspace yields ^W (0x17) |
Hrm... Looking through some terminal sequence documentation I see that I will have to dive into the ANSI code parsing of crossterm to see why this is not throwing a backspace event. It could be the case it is not yet supported in combinations with CTRL. |
As far as I've understood the /src/event/sys/unix/parse.rs code, the following lines in parse_event c @ b'\x01'..=b'\x1A' => Ok(Some(InternalEvent::Event(Event::Key(KeyEvent::new(
KeyCode::Char((c as u8 - 0x1 + b'a') as char),
KeyModifiers::CONTROL,
))))), (line 83 and following) |
I wrote a possible solution at #506 , feel free to change the style |
Maybe it would be a cleaner solution, if one added another KeyCode type ControlCode to raise the programmers awareness for other control codes like ^W (which I hardcoded to ctrl + backspace). |
Could someone fix this? It is a real show stopper for people used to the |
Also would love to see this added! Was banging my head against the wall trying to figure out why there were no modifiers when I hit backspace until I realized this just wasn't supported lol |
Closing in favor of #685. |
Describe the bug
If I press backspace together with a modifier like ctrl or shift, it gets interpreted as char + modifier.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In case of ctrl + backspace, it should delete unicode words. in other cases it should delete the last unicode grapheme.
OS
Terminal/Console
Language
German
The text was updated successfully, but these errors were encountered: