From 123645214dbf2ca433ee858d745795423a27ce18 Mon Sep 17 00:00:00 2001 From: Philip Zeyliger Date: Mon, 26 Jan 2026 09:21:48 -0800 Subject: [PATCH] shelley: use Cmd+K on macOS, Ctrl+K elsewhere for command palette MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prompt: Fix https://github.com/boldsoftware/shelley/issues/52 This preserves the native Ctrl+K (kill to end of line) emacs-style shortcut on macOS. Fixes https://github.com/boldsoftware/shelley/issues/52 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- ui/src/App.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 7efec56c19d7a2edb0aa4d11e33ea633141522b4..f393c6e291c009c38dc53526513cb3352d165e07 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -113,10 +113,14 @@ function App() { loadConversations(); }, []); - // Global keyboard shortcut for command palette (Cmd+K / Ctrl+K) + // Global keyboard shortcut for command palette (Cmd+K on macOS, Ctrl+K elsewhere) useEffect(() => { + const isMac = navigator.platform.toUpperCase().includes("MAC"); const handleKeyDown = (e: KeyboardEvent) => { - if ((e.metaKey || e.ctrlKey) && e.key === "k") { + // On macOS use Cmd+K, on other platforms use Ctrl+K + // This preserves native Ctrl+K (kill to end of line) on macOS + const modifierPressed = isMac ? e.metaKey : e.ctrlKey; + if (modifierPressed && e.key === "k") { e.preventDefault(); setCommandPaletteOpen((prev) => !prev); }