From 2e2e151aa046d54347643edd6df5d6a5ff00bca0 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 16 Apr 2026 13:35:47 -0700 Subject: [PATCH] =?UTF-8?q?Change=20New=20Markdown=20shortcut=20from=20?= =?UTF-8?q?=E2=8C=98=E2=87=A7N=20to=20=E2=8C=98=E2=87=A7M=20(#724)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⌘⇧N conflicts with the well-known "New Window" convention in VS Code and Chrome. ⌘⇧M is a clear mnemonic for Markdown and doesn't clash with any existing shortcut. Also adds New Browser Tab and New Markdown entries to the Settings keyboard shortcuts pane. --- src/renderer/src/components/Terminal.tsx | 6 +++--- .../src/components/settings/ShortcutsPane.tsx | 14 ++++++++++++-- src/renderer/src/components/tab-bar/TabBar.tsx | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/Terminal.tsx b/src/renderer/src/components/Terminal.tsx index 35d20f8b625..a30d180a5d7 100644 --- a/src/renderer/src/components/Terminal.tsx +++ b/src/renderer/src/components/Terminal.tsx @@ -285,7 +285,7 @@ function Terminal(): React.JSX.Element | null { return } try { - // Why: the global Cmd/Ctrl+Shift+N shortcut is handled here rather than + // Why: the global Cmd/Ctrl+Shift+M shortcut is handled here rather than // inside a specific TabGroupPanel, so it must snapshot the store's // current focused group explicitly. Otherwise split layouts fall back to // the ambient/default group and open the file in the wrong pane. @@ -558,8 +558,8 @@ function Terminal(): React.JSX.Element | null { } } - // Cmd/Ctrl+Shift+N - new file - if (mod && e.shiftKey && e.key.toLowerCase() === 'n' && !e.repeat) { + // Cmd/Ctrl+Shift+M - new markdown file + if (mod && e.shiftKey && e.key.toLowerCase() === 'm' && !e.repeat) { e.preventDefault() void handleNewFile() return diff --git a/src/renderer/src/components/settings/ShortcutsPane.tsx b/src/renderer/src/components/settings/ShortcutsPane.tsx index bf21e0648b9..641d748d4c9 100644 --- a/src/renderer/src/components/settings/ShortcutsPane.tsx +++ b/src/renderer/src/components/settings/ShortcutsPane.tsx @@ -105,10 +105,20 @@ const SHORTCUT_GROUP_DEFINITIONS: ShortcutGroupDefinition[] = [ title: 'Terminal Tabs', items: [ { - action: 'New tab', - searchKeywords: ['shortcut', 'tab'], + action: 'New Terminal', + searchKeywords: ['shortcut', 'tab', 'terminal'], keys: ({ mod }) => [mod, 'T'] }, + { + action: 'New Browser Tab', + searchKeywords: ['shortcut', 'tab', 'browser'], + keys: ({ mod, shift }) => [mod, shift, 'B'] + }, + { + action: 'New Markdown', + searchKeywords: ['shortcut', 'tab', 'markdown', 'file'], + keys: ({ mod, shift }) => [mod, shift, 'M'] + }, { action: 'Close active tab / pane', searchKeywords: ['shortcut', 'close', 'tab', 'pane'], diff --git a/src/renderer/src/components/tab-bar/TabBar.tsx b/src/renderer/src/components/tab-bar/TabBar.tsx index 6389abcf760..06a79ebcb31 100644 --- a/src/renderer/src/components/tab-bar/TabBar.tsx +++ b/src/renderer/src/components/tab-bar/TabBar.tsx @@ -32,7 +32,7 @@ import { const isMac = navigator.userAgent.includes('Mac') const NEW_TERMINAL_SHORTCUT = isMac ? '⌘T' : 'Ctrl+T' const NEW_BROWSER_SHORTCUT = isMac ? '⌘⇧B' : 'Ctrl+Shift+B' -const NEW_FILE_SHORTCUT = isMac ? '⌘⇧N' : 'Ctrl+Shift+N' +const NEW_FILE_SHORTCUT = isMac ? '⌘⇧M' : 'Ctrl+Shift+M' type TabBarProps = { tabs: TerminalTab[]