fix: only run shell keybinding defaults from the shell

This commit is contained in:
LukeGus committed 2026-11-06 20:49:47 -06:00
1 parent 4584aff32b
commit e033025657
1 file changed
+5 -1
@@ -20,6 +20,7 @@ import {
GLOBAL_KEYBINDING_EVENT, GLOBAL_KEYBINDING_EVENT,
getKeybindingAction, getKeybindingAction,
listKeybindingDefaults, listKeybindingDefaults,
SHELL_KEYBINDING_ACTION_IDS,
runKeybindingAction, runKeybindingAction,
} from "@/shell/keybinding-registry"; } from "@/shell/keybinding-registry";
import { globalShortcutHandler } from "@/lib/global-shortcut-handler"; import { globalShortcutHandler } from "@/lib/global-shortcut-handler";
@@ -121,11 +122,14 @@ export function useShellKeybindings({
return; return;
} }
// Plugins run their own defaults, so only the shell's are handled here.
const defaultBinding = listKeybindingDefaults().find( const defaultBinding = listKeybindingDefaults().find(
(entry) => (entry) =>
SHELL_KEYBINDING_ACTION_IDS.includes(entry.id) &&
!customBindings.some( !customBindings.some(
(custom) => custom.overridesDefaultId === entry.id, (custom) => custom.overridesDefaultId === entry.id,
) && eventMatchesCombo(event, entry.combo), ) &&
eventMatchesCombo(event, entry.combo),
); );
if (!defaultBinding || !getKeybindingAction(defaultBinding.id)) return; if (!defaultBinding || !getKeybindingAction(defaultBinding.id)) return;
event.preventDefault(); event.preventDefault();