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

Kitty Keyboard encoding has incorrect modifier bits for modifier keys #4965

Open
rockorager opened this issue Jan 12, 2025 · 3 comments
Open
Labels
input Keyboard or mouse input

Comments

@rockorager
Copy link
Member

rockorager commented Jan 12, 2025

When using kitty keyboard protocol encoding, Ghostty incorrectly sets the modifier bits. Per the specification:

When the key event is related to an actual modifier key, the corresponding modifier’s bit must be set to the modifier state including the effect for the current event.

I tested this on Alacritty, Foot, Kitty, and Ghostty. All except Ghostty have the same encoding for this keypress.

I suspect this is only on a GTK build under Wayland, due to how Wayland delivers modifier presses + modifier events.

Repro Steps

  1. kitten show_key -m kitty
  2. Press control

Expected Output

CSI 57442 ; 5 u (press)

CSI 57442; 1 : 3 u (release)

Actual Output

CSI 57442 u (press)

CSI 57442 ; 5 : 3 u (release)

Reference: kovidgoyal/kitty#6913 (comment)

@mitchellh mitchellh added the input Keyboard or mouse input label Jan 12, 2025
@wexman
Copy link

wexman commented Feb 18, 2025

Seeing the ;5u here makes me think if my problem is related? It is that some keybindings are not working as expected. For example, ctrl+shift+comma which should reload the config insteat outputs ;5u to the screen.

Is that the same problem?

using zsh on Linux Mint with a german keyboard layout if that matters.

@00-kat
Copy link
Contributor

00-kat commented Feb 18, 2025

Unlikely since the Kitty keyboard protocol isn't used for Ghostty's own keybindings. Though it's possible that they have the same underlying cause.

@wexman
Copy link

wexman commented Feb 18, 2025

So should I open a separate issue for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input Keyboard or mouse input
Projects
None yet
Development

No branches or pull requests

4 participants