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

macOS 15: Kitty v0.28.1 to v0.33.1 - Q key in Kitty key protocol emits only repeat #7582

Closed
chase opened this issue Jun 30, 2024 · 4 comments
Labels

Comments

@chase
Copy link
Contributor

chase commented Jun 30, 2024

Describe the bug

When in an application that uses the full Kitty key protocol mode, q emits press once, then only q emits the repeat event unless it is preceded by a use with modifiers, then it again emits the press event (but no repeat or up events).

Other keys seem to work fine except for a, which emits down events for the first and all repeating events instead of repeat events.

To Reproduce
Steps to reproduce the behavior:

  1. Open kitty with kitty --config NONE
  2. kitten show-key -m kitty
  3. Press Q key
q PRESS q
CSI 113 ;  ; 113 u
  1. Press Q key (again)
q REPEAT q
CSI 113 ; 1 : 2 ; 113 u
  1. Press Q key (again)
q REPEAT q
CSI 113 ; 1 : 2 ; 113 u
  1. Press Shift+Q key
shift+q REPEAT Q
CSI 113 : 81 ; 2 : 2 ; 81 u
Shifted key: Q 

shift+q RELEASE 
CSI 113 : 81 ; 2 : 3 u
Shifted key: Q 

LEFT_SHIFT RELEASE 
CSI 57441 ; 1 : 3 u
  1. Press Shift+Q key
shift+q REPEAT Q
CSI 113 : 81 ; 2 : 2 ; 81 u
Shifted key: Q 

shift+q RELEASE 
CSI 113 : 81 ; 2 : 3 u
Shifted key: Q 

LEFT_SHIFT RELEASE 
CSI 57441 ; 1 : 3 u
  1. Press Q
q PRESS q
CSI 113 ;  ; 113 u

Screenshots

Screen.Recording.2024-07-01.at.1.46.19.AM.mov

Environment details

kitty 0.33.1 (a5fea33757) created by Kovid Goyal
Darwin Chases-MacBook-Air.local 24.0.0 Darwin Kernel Version 24.0.0: Thu May 30 21:31:14 PDT 2024; root:xnu-11215.0.31.511.2~1/RELEASE_ARM64_T8112 arm64
ProductName:		macOS ProductVersion:		15.0 BuildVersion:		24A5264n
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh

Config options different from defaults:
Removed shortcuts:
	cmd+, →  edit_config_file
	cmd+enter →  new_window
	cmd+h →  hide_macos_app
	cmd+k →  clear_terminal to_cursor active
	cmd+m →  minimize_macos_window
	cmd+n →  new_os_window
	cmd+q →  quit
	cmd+t →  new_tab
	cmd+w →  close_tab
	ctrl+cmd+, →  load_config_file
	ctrl+cmd+f →  toggle_fullscreen
	opt+cmd+h →  hide_macos_other_apps
	opt+cmd+r →  clear_terminal reset active
	opt+cmd+s →  toggle_macos_secure_keyboard_entry
	shift+cmd+/ →  open_url https://sw.kovidgoyal.net/kitty/
	shift+cmd+[ →  previous_tab
	shift+cmd+] →  next_tab
	shift+cmd+d →  close_window
	shift+cmd+w →  close_os_window

Important environment variables seen by the kitty process:
	PATH                                /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/kitty.app/Contents/MacOS
	LANG                                en_US.UTF-8
	EDITOR                              nvim
	SHELL                               /bin/zsh
	USER                                chase
@chase chase added the bug label Jun 30, 2024
@kovidgoyal
Copy link
Owner

The current version of kitty is 0.35.1 and with this version I cannot
replicate on my mac. If you are getting incorrect events on yours it
will be because something on your system is causing incorrect events to
be delivered to kitty. Easily checked by running kitty with
--debug-input

@chase
Copy link
Contributor Author

chase commented Jul 1, 2024

Updated to 0.35.1 and I was still able to reproduce the issues.
With --debug-input this appears to be the issue for Q: keyDown triggered global macOS shortcut ignoring
Unfortunately the a not repeating doesn't seem to trigger anything.

But I was able to figure out which "global macOS shortcut" it was referring to:
image

Disabling the Quick Note shortcut causes q to behave correctly, however that would mean that the code to detect the shortcut is incorrect. The shortcut is 🌐Q not just Q.

@kovidgoyal
Copy link
Owner

Quick note is not disabled on my mac and it does not interfere with Q.

@chase
Copy link
Contributor Author

chase commented Jul 1, 2024

Ah, so it might be a macOS 15 issue? It looks like the function (globe) modifier isn't accounted for here:
https://github.com/kovidgoyal/kitty/blob/master/glfw/cocoa_init.m#L582

I believe NSEventModifierFlagFunction should be included as well? Looking at the com.apple.symbolichotkeys entry, it has:
8388608 which is NSEventModifierFlagFunction:

        190 =         {
            enabled = 1;
            value =             {
                parameters =                 (
                    113,
                    12,
                    8388608
                );
                type = standard;
            };
        };

@kovidgoyal kovidgoyal reopened this Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants