macOS: Fix a regression in the previous release that broke overriding keyboard shortcuts for actions present in the global menu bar

Fixes #7016
This commit is contained in:
Kovid Goyal 2024-01-19 19:44:04 +05:30
parent 0bd50abd77
commit 89c3b4f9e2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 5 deletions

View File

@ -43,6 +43,11 @@ The :doc:`ssh kitten <kittens/ssh>` is redesigned with powerful new features:
Detailed list of changes
-------------------------------------
0.32.1 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- macOS: Fix a regression in the previous release that broke overriding keyboard shortcuts for actions present in the global menu bar (:iss:`7016`)
0.32.0 [2024-01-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -219,11 +219,11 @@ def set_cocoa_global_shortcuts(opts: Options) -> Dict[str, SingleKey]:
if is_macos:
from collections import defaultdict
func_map = defaultdict(list)
for k, v in opts.keyboard_modes[''].keymap.items():
for kd in v:
if kd.is_suitable_for_global_shortcut:
parts = tuple(kd.definition.split())
func_map[parts].append(k)
for single_key, v in opts.keyboard_modes[''].keymap.items():
kd = v[-1] # the last definition is the active one
if kd.is_suitable_for_global_shortcut:
parts = tuple(kd.definition.split())
func_map[parts].append(single_key)
for ac in ('new_os_window', 'close_os_window', 'close_tab', 'edit_config_file', 'previous_tab',
'next_tab', 'new_tab', 'new_window', 'close_window', 'toggle_macos_secure_keyboard_entry', 'toggle_fullscreen',