-
Notifications
You must be signed in to change notification settings - Fork 285
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
Tracking: Missing key combinations #685
Comments
@TimonPost |
It depends if the terminal supports escape codes for certain special key combinations. It indeed might be the case that it can be mapped but isn't implemented yet, in that case, it's a simple addition to the existing parsing code. If you have any in mind feel free to add them. |
@TimonPost Edit: Same result using bash as well. |
Can this be closed with the addition of the keyboard enhancement feature to 0.25? That support is limited to certain terminals, but most of these are unsupportable without it. |
This issue tracks all kinds of missing key combinations so can not be closed as there are still some left |
i want to ask a question about the items that dont have a for example
another question: they corresponding issues are closed in favor of this one, right?
note: im using
|
Yes, I need to go through them again and add boxes for combinations that have no solution yet. Will add a note that not all are solved. |
another technical question, please, is there a way to get a to at least to see what cant see anything like that in the docs. |
Please join the discord for questions like this, prefer to keep this thread short |
As mentioned in #771. |
this works in termwiz (linux) so its probably doable |
@coastalwhite which terminal/os shift+tab work for me (linux/wezterm) For anyone trying to report a bug in key combo please do:
|
Sorry for not being entirely clear. This is purely a Linux TTY issue, it works fine in any non-TTY terminal I have tried (Alacritty, Kitty, etc.). So if you run
|
just making it clear that #669 is still unresolved – |
I am unable to get |
turns out thiis works with the kitty protocol, in linux wezterm (with enable_kitty_keyboard=true) I have this working now ctrl+shift+letter ctrl+shift+enter |
On Linux terminal, keycodes for `^/`, `^_`, and `^7` are the same. The parsed key depends on the library that handles the input. In case of Zee, it uses Zi framework for terminal based applications, which uses crossterm library to get key events. For more details, see crossterm issues: - crossterm-rs/crossterm#540 - crossterm-rs/crossterm#685 To check if it reproduces on your machine, you can try ``` showkey --ascii ``` - Crossterm - https://github.com/crossterm-rs/crossterm - Zi - https://github.com/mcobzarenco/zi
The debug steps are for Unix. I have added a log_to_file(..) function to the function I only used one example for this. There are other cases. If there is no general solution then I can post logs for these too. The output is (with added comments):
|
It might make sense to actually add logging to this (I'm partial to the tracing crate rather than the log crate as the structured logging is often more useful than unstructured approach in logs). |
I can try that. I have a general question. Modifiers are intended to be consumed when they change the character, correct? |
No, shift+a is shift+A
My guess is that this was implemented this way to make it easy to treat
I don't really have too many answers on this. Those questions really come down to reading the various terminal emulators documentation and digging into their quirks to understand what is happening. Non-english key handling is something I don't know a lot about, and I'd guess it's probably got some differences on each operating system. BTW, to set expectations, I'm by no means an expert on crossterm. Just helping out where I can because we use it in Ratatui a lot. |
Oh wow, thanks for pointing that out! |
Well that was a weird fix. It doesn't seem like crossterm's support for my macOS terminal is very good. Control+M generates a `KeyCode::Enter` event. All Alt+letter hotkeys generate an event for some non-ascii character with no modifiers set. You get a different character for every key you press with Alt. It seems like maybe some or all of this issue might be being tracked at crossterm-rs/crossterm#685 Plus I'm trying to avoid default macOS hotkeys. I also updated crossterm hoping that it would address some of the above problems but it did not. So yeah, a little bit of a messy update.
Parsing ANSI codes to input events is a pain. There is no good way to tell which terminals implement which key combinations. Therefore it might occur that some terminals do support certain key presses while others dont. This issue serves as a tracking issue and lists various keys that are reported missing. Either it might be that crossterm has not yet implemented it or that the terminal doesn't support the key combination. Please post your missing keys in this issue.
The supported events are often even different in each terminal emulator. For background on the extended ways that terminals can report keys see see https://sw.kovidgoyal.net/kitty/keyboard-protocol/ and http://www.leonerd.org.uk/hacks/fixterms/. Crossterm supports the kitty protocol using the PushKeyboardEnhancementFlags command.
How to debug
This code is responsible for parsing a bytes buffer to an event. If you miss a key, it is useful if you can print the buffer with
println!("Buffer: {:?}, buffer)
in this function. Then report that value with the missing keys in this issue. That way we can trace back and see if crossterm should add parsing logic for that buffer.Reported Missing
Ctrl + Enter
= modifiers::NONE (iTerm2, Terminal.app, gnome-terminal,VSCode Integrated Terminal)Shift
/Ctrl
+Enter
returnsmodifiers::NONE
#669, inconsistent reporting of ^Enter #508Shift + Enter
= modifiers::NONE (iTerm2, Terminal.app, gnome-terminal,VSCode Integrated Terminal)Shift
/Ctrl
+Enter
returnsmodifiers::NONE
#669Alt + Enter
= modifiers::ALT (iTerm2, Terminal.app, VSCode Integrated Terminal)Shift
/Ctrl
+Enter
returnsmodifiers::NONE
#669Alt + Enter
= modifiers::NONE (iTerm2, Terminal.app)Shift
/Ctrl
+Enter
returnsmodifiers::NONE
#669Cmd + Arrow Right
= Some gibberish events (IntelliJ IDEA Terminal) Badly handles Cmd + Arrow in IntelliJ Terminal #597ALT + [
= doesnt work.ALT + ]
Doesnt work.Ctrl+Backspace
= Missing modifier (iTerm2) macOS, backspace, and modifiers #575, Backspace with modifiers not recognised as backspace #504Alt+Backspace
= Missing modifier (iTerm2) macOS, backspace, and modifiers #575, Backspace with modifiers not recognised as backspace #504Shift + F3
Key Event not read (ubunutu) Shift + F3 Key Event not read. #513note: not all are solved
Note
Please do not create a separate issue for missing combinations, instead comment in this issue such that I can update the above list. The above list contains combinations that might have been fixed or missing combinations that are still to be fixed.
The text was updated successfully, but these errors were encountered: