From 89c3b4f9e22422767fa5b18ff08a0ea317fd0687 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Jan 2024 19:44:04 +0530 Subject: [PATCH] macOS: Fix a regression in the previous release that broke overriding keyboard shortcuts for actions present in the global menu bar Fixes #7016 --- docs/changelog.rst | 5 +++++ kitty/main.py | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 68d6bf3ba..2bd3167db 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -43,6 +43,11 @@ The :doc:`ssh kitten ` 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] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/main.py b/kitty/main.py index f9c6a7767..5c6788d46 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -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',