Skip to content

[macOS] Quit/close prompt does not accept "y" and "n" keys #6189

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

Closed
screendriver opened this issue Apr 16, 2023 · 9 comments
Closed

[macOS] Quit/close prompt does not accept "y" and "n" keys #6189

screendriver opened this issue Apr 16, 2023 · 9 comments
Labels

Comments

@screendriver
Copy link

screendriver commented Apr 16, 2023

Describe the bug

Since v0.28.0 I cannot press the y or n key in the quit / close prompt. The only keys that are working are Enter and Escape. Before v.0.28.0 this was working as intended.

To Reproduce
Steps to reproduce the behavior:

  1. try to close kitty with two tabs open with Cmd + q
  2. try to press y or n key
  3. nothing happens

Screenshots

Screenshot 2023-04-16 at 10 34 25

Environment details

Minimal configuration to reproduce the issue:

kitty 0.28.0 (b81f457e9b) created by Kovid Goyal
Darwin Mac.here 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103 arm64
ProductName:		macOS ProductVersion:		13.3.1 BuildVersion:		22E261
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
Loaded config files:
  /Users/me/.config/kitty/kitty.conf

Config options different from defaults:
confirm_os_window_close 1

Important environment variables seen by the kitty process:
	PATH                                /opt/homebrew/bin:/usr/local/bin:/var/folders/85/8rb_y49j5911bg5qzd7tkddw0000gp/T/fnm_multishell_19222_1612159369334/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Applications/kitty.app/Contents/MacOS
	LANG                                en_US.UTF-8
	SHELL                               /bin/zsh
	USER                                screendriver

@screendriver screendriver changed the title [macOS] Quit prompt does not accept "y" and "n" keys [macOS] Quit/close prompt does not accept "y" and "n" keys Apr 16, 2023
@kovidgoyal
Copy link
Owner

Doesnt repro for me on either my linux or mac boxes, with and without caps lock engaged. What does running

kitty +kitten show_key -m kitty

and pressing the y key show for you?

@screendriver
Copy link
Author

I'm using an alternative keyboard layout called Neo.

kitty +kitten show_key -m kitty

Press any keys - Ctrl+C or Ctrl+D will terminate
y PRESS y
CSI 121 :  : 39 ;  ; 121 u
Alternate key: ' 

y RELEASE 
CSI 121 :  : 39 ; 1 : 3 u
Alternate key: ' 

n PRESS n
CSI 110 :  : 106 ;  ; 110 u
Alternate key: j 

n RELEASE 
CSI 110 :  : 106 ; 1 : 3 u
Alternate key: j 

@kovidgoyal
Copy link
Owner

Seems OK to me, I dont see why that should fail. Does it work if you
temporarily switch layout back to the normal one?

@kovidgoyal
Copy link
Owner

Also can you post the output of running

kitty --debug-keyboard

and pressing the y key

@screendriver
Copy link
Author

When I switch to my normal (German) layout then n is working again but y is still ignored (because it is interpreted as z):

Press any keys - Ctrl+C or Ctrl+D will terminate
y PRESS y
CSI 121 :  : 122 ;  ; 121 u
Alternate key: z 

y RELEASE 
CSI 121 :  : 122 ; 1 : 3 u
Alternate key: z 

n PRESS n
CSI 110 ;  ; 110 u

n RELEASE 
CSI 110 ; 1 : 3 u

The reason for that is that on a German Keyboard z and y are switched

@kovidgoyal
Copy link
Owner

Sorry make that

kitty --debug-keyboard kitty +kitten ask -t yesno

@screendriver
Copy link
Author

kitty --debug-keyboard kitty +kitten ask -t yesno

With Neo Layout:

❯ kitty --debug-keyboard kitty +kitten ask -t yesno
Pushed key encoding flags to: 29
on_focus_change: window id: 0x1 focused: 1
---------------- key down -------------------
NSEvent: type=KeyDown loc=(-60.207,382.254) time=75705.7 flags=0x100 win=0x10af718e0 winNum=18709 ctxt=0x0 chars="y" unmodchars="y" repeat=0 keyCode=39
Press: native_key: 0x27 (y) glfw_key: 0x79 mods: none char_count: 1 deadKeyState: 0 repeat: 0 
	insertText: y replacementRange: (9223372036854775807, 0)
text: 0x79 glfw_key: y marked_text: ()
on_key_input: glfw key: 0x79 native_code: 0x27 action: PRESS mods: none text: 'y' state: 0 sent encoded key to child: ^[ [ 1 2 1 : : 3 9 ; ; 1 2 1 u 
----------------- key up --------------------
NSEvent: type=KeyUp loc=(-60.207,382.254) time=75705.9 flags=0x100 win=0x10af718e0 winNum=18709 ctxt=0x0 chars="y" unmodchars="y" repeat=0 keyCode=39
Release: native_key: 0x27 (y) glfw_key: 0x79 mods: none 
on_key_input: glfw key: 0x79 native_code: 0x27 action: RELEASE mods: none text: '' state: 0 ignoring as keyboard mode does not support encoding this event
on_focus_change: window id: 0x1 focused: 0

kitty --debug-keyboard kitty +kitten ask -t yesno

With German layout:

❯ kitty --debug-keyboard kitty +kitten ask -t yesno
Pushed key encoding flags to: 29
on_focus_change: window id: 0x1 focused: 1
Move x: 837.7 y: 631.6 grabbed: 1
---------------- key down -------------------
NSEvent: type=KeyDown loc=(418.859,559.176) time=75804.9 flags=0x100 win=0x107f2b450 winNum=18821 ctxt=0x0 chars="y" unmodchars="y" repeat=0 keyCode=6
Press: native_key: 0x6 (y) glfw_key: 0x79 mods: none char_count: 1 deadKeyState: 0 repeat: 0 
	insertText: y replacementRange: (9223372036854775807, 0)
text: 0x79 glfw_key: y marked_text: ()
on_key_input: glfw key: 0x79 native_code: 0x6 action: PRESS mods: none text: 'y' state: 0 sent encoded key to child: ^[ [ 1 2 1 : : 1 2 2 ; ; 1 2 1 u 
----------------- key up --------------------
NSEvent: type=KeyUp loc=(418.859,559.176) time=75805.0 flags=0x100 win=0x107f2b450 winNum=18821 ctxt=0x0 chars="y" unmodchars="y" repeat=0 keyCode=6
Release: native_key: 0x6 (y) glfw_key: 0x79 mods: none 
on_key_input: glfw key: 0x79 native_code: 0x6 action: RELEASE mods: none text: '' state: 0 ignoring as keyboard mode does not support encoding this event

@kovidgoyal
Copy link
Owner

OK I'll look into it when I have a moment

@screendriver
Copy link
Author

Thanks 👍 No hurry 🙂 (something must have changed recently because in all previous kitty versions it was working fine)

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