From 34504cbfd5a54df0cd643f6137d6939dc7e88d37 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Sat, 30 May 2026 16:09:31 -0400 Subject: [PATCH] fix: tighten quick command submit shortcut --- .../TerminalQuickCommandDialog.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx b/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx index 0ea010eadde..60eb8dfd5c4 100644 --- a/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx +++ b/src/renderer/src/components/terminal-quick-commands/TerminalQuickCommandDialog.tsx @@ -26,8 +26,8 @@ import { SelectTrigger, SelectValue } from '@/components/ui/select' -import { isMacUserAgent } from '@/components/terminal-pane/pane-helpers' import { AGENT_CATALOG, AgentIcon } from '@/lib/agent-catalog' +import { getScreenSubmitShortcutLabel, isScreenSubmitShortcut } from '@/lib/screen-submit-shortcut' import type { TuiAgent } from '../../../../shared/types' import { TerminalQuickCommandActionToggle } from './TerminalQuickCommandActionToggle' import { TerminalQuickCommandAppendEnterSwitch } from './TerminalQuickCommandAppendEnterSwitch' @@ -161,8 +161,7 @@ export function TerminalQuickCommandDialog({ (isTerminalAgentQuickCommand(draft) ? draft.prompt.trimEnd().length > 0 && supportsTerminalAgentQuickCommand(draft.agent) : draft.command.trimEnd().length > 0) - const isMac = isMacUserAgent() - const submitShortcutLabel = isMac ? '⌘↵' : 'Ctrl+Enter' + const submitShortcutLabel = getScreenSubmitShortcutLabel() return ( @@ -179,11 +178,7 @@ export function TerminalQuickCommandDialog({
{ - // Why: cross-platform submit shortcut — Cmd+Enter on Mac, Ctrl+Enter - // elsewhere. Falls through to native textarea/Input newline insertion - // when the platform modifier isn't held. - const platformSubmit = isMac ? event.metaKey : event.ctrlKey - if (event.key === 'Enter' && platformSubmit && canSave) { + if (isScreenSubmitShortcut(event) && canSave) { event.preventDefault() saveDraft() }