-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Incorrect "Disambiguate escape codes" behaviour using enable_kitty_keyboard #3621
Comments
I'm running into this as well while trying to use Within
When I run
|
I was able to work around this issue (delete key not being sent as expected) by adding the following to my keybinds: keys = {
...
{ key = "Delete", action = act.SendKey { key = "Delete" } },
...
} This suggests that WezTerm knows how to send the correct codes, but perhaps has some compatibility layer or keymap turned on? I have the following (what I assume to be potentially relevant) config: config.disable_default_key_bindings = true
config.allow_win32_input_mode = false
config.enable_kitty_keyboard = true
config.enable_csi_u_key_encoding = false
config.term = "wezterm" For me this was affecting correct use of the delete key in nushell, and the helix editor. I would love for this to be fixed; sadly I am too new to rust to feel comfortable investigating this. |
What Operating System(s) are you seeing this problem on?
Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
Hyprland
WezTerm version
20230425-083942-6686adba
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
The main issue I'm having is that Neovim is detecting the delete character as <CTRL-H>, but when investigating I found a bunch of differences between Wezterm and Kitty when the "Disambiguate escape codes" enhancement is enabled.
To Reproduce
I used another slightly modified version of the program in #3526 to test it, now having 'c' exit the loop instead of Enter:
Configuration
Expected Behavior
The reason for the issue is that Wezterm is sending \x08 for <DEL>, which is the same code that <CTRL-H> would send. From the keyboard protocol docs here, when in "Disambiguate escape codes" mode, all non-text generating events should emit the new unambiguous codes and not the legacy codes.
These are the important differences I found by basically pressing every key on my keyboard:
For Backspace, Tab and Enter, the Kitty docs are (ironically) a bit ambiguous on whether lock modifiers (ie Num Lock and Caps Lock) should cause those keys to stop emitting their legacy codes. In this case I actually think wezterm has the more sensible behaviour, especially given the reasoning in the docs for why those three specific keys are an exception to the new encoding system. If a program using the kitty protocol crashes, and you always have Num Lock enabled (like I do), then you wouldn't be able to use Backspace, Tab and Enter for recovery in the shell until Num Lock is disabled.
For F1, F5 and HOME (and almost all other non-text generating keys), Wezterm is sending the default modifier field of 1 along with the normal code, where Kitty just omits the modifier field since 1 is to be assumed if the field is missing. The Kitty docs don't seem to explicitly require the modifier field to be omitted if it is 1, but since the codes are different I thought I might as well include it on this list. I don't think that is an issue.
For F1, I also just included it because the codes are different - the Kitty docs allow for both forms. F2 and F4 are also different for the same reason. Again, I don't think it's an issue.
For Escape, Delete and the keypad Enter key, the behaviour is definitely incorrect - the legacy codes should not be sent. For Pause/Break and Menu, these should of course send the correct codes instead of nothing at all, but adding support for those keys is definitely less important and would be more of a nice to have.
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: