Skip to content

Commit

Permalink
macOS: Fix a regression in the previous release that broke overriding…
Browse files Browse the repository at this point in the history
… keyboard shortcuts for actions present in the global menu bar

Fixes #7016
  • Loading branch information
kovidgoyal committed Jan 19, 2024
1 parent 0bd50ab commit 89c3b4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 5 additions & 5 deletions kitty/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 89c3b4f

Please sign in to comment.