zed
zed copied to clipboard
Fix macOS App shortcut
Release Notes:
- Fixed macOS App Shortcut
The App Shortcuts in macOS System Settings does not work for Zed since the menu titles were not set.
See https://github.com/kovidgoyal/kitty/issues/5132 for the symptom in another App and https://github.com/henryhchchc/kitty/commit/1978cc5b55374a470515b7be6410386c748f48e7 for a similar fix.
| Messages | |
|---|---|
| :book: |
This PR includes links to the following GitHub Issues: #https://github.com/kovidgoyal/kitty/issues/5132
If this PR aims to close an issue, please include a |
Generated by :no_entry_sign: dangerJS against 96aca6ae6a09c67003861d98b1f6e8be39b8f2fd
I know Zed has some issue with global MacOS shortcuts but can you provide an explicit description as to what this fixed and how I should test it? Thanks
@notpeter can you provide an explicit description
Sure.
Currently we cannot assign shortcuts for the app menu in Zed with [System Settings -> Keyboard -> Keyboard Shortcuts... -> App Shortcuts]. For example, I tried to assign Cmd-Control-C to Window->Center (Figure 1). It works for other apps (Figure 2) but does not work for Zed without the patch (Figure 3).
The reason is that macOS assigns these shortcuts by matching the titles of the menu items. In the current version, only the title of the inner menu (i.e., menu) is set, but the title of the outer menu (i.e., menu_item) is not set.
To fix this, I set the title of the outer menu as well. In this case, the app shortcuts work (Figure 4).
Figure 1: Setting App Shortcuts
Figure 2: It works for Finder
Figure 3: It does not work for Zed (w/o the patch)
Figure 4: It works for Zed (w/ the patch)
Interesting. What you're describing already works for me in Nightly on MacOS Sonoma 14.7:
I wonder if this is a Sequoia-specific quirk.
I wonder if this is a Sequoia-specific quirk.
Probably not. To reproduce the issue, try "Window->Zoom" in System Settings instead of "Zoom".
Probably not. To reproduce the issue, try "Window->Zoom" in System Settings instead of "Zoom".
Today I learned. I wonder how long this has been around. I always thought the design-guide requirement that menu items be globally unique across an app was an elegant way to enforce some order on a chaotic world (forbidding the hell of "Tools->Options or File->Options?" which is so common on windows). I'm glad this is supported, but I would've never expected Apple to choose -> to make it work.
Thanks! And congrats on your first contribution to Zed!