From e3d86dc193eff2d2783a214c8fc6da468233f17c Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:59:36 -0700 Subject: [PATCH] fix: align shortcut labels and remove shift-enter terminal intercept (#144) --- .../components/sidebar/WorktreeMetaDialog.tsx | 3 +- .../terminal-pane/keyboard-handlers.ts | 29 ------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/renderer/src/components/sidebar/WorktreeMetaDialog.tsx b/src/renderer/src/components/sidebar/WorktreeMetaDialog.tsx index b1055bfbc2f..fd4c3e063ac 100644 --- a/src/renderer/src/components/sidebar/WorktreeMetaDialog.tsx +++ b/src/renderer/src/components/sidebar/WorktreeMetaDialog.tsx @@ -35,6 +35,7 @@ const WorktreeMetaDialog = React.memo(function WorktreeMetaDialog() { const [issueInput, setIssueInput] = useState('') const [commentInput, setCommentInput] = useState('') const [saving, setSaving] = useState(false) + const isMac = navigator.userAgent.includes('Mac') const issueInputRef = useRef(null) const textareaRef = useRef(null) @@ -202,7 +203,7 @@ const WorktreeMetaDialog = React.memo(function WorktreeMetaDialog() { className="w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-2 text-xs shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 resize-none max-h-60 overflow-y-auto" />

- Press Enter or Cmd+Enter to save, Shift+Enter for a new line. + Press Enter or {isMac ? 'Cmd' : 'Ctrl'}+Enter to save, Shift+Enter for a new line.

diff --git a/src/renderer/src/components/terminal-pane/keyboard-handlers.ts b/src/renderer/src/components/terminal-pane/keyboard-handlers.ts index 37743a9a37e..291f2961913 100644 --- a/src/renderer/src/components/terminal-pane/keyboard-handlers.ts +++ b/src/renderer/src/components/terminal-pane/keyboard-handlers.ts @@ -241,42 +241,13 @@ export function useTerminalKeyboardShortcuts({ transport?.sendInput('\x1b\x7f') } - // Shift+Enter → insert a literal newline into the shell command line. - const onShiftEnter = (e: KeyboardEvent): void => { - if (!e.shiftKey || e.metaKey || e.altKey || e.ctrlKey) { - return - } - if (e.key !== 'Enter') { - return - } - if (isEditableTarget(e.target)) { - return - } - - const manager = managerRef.current - if (!manager) { - return - } - - e.preventDefault() - e.stopPropagation() - const pane = manager.getActivePane() ?? manager.getPanes()[0] - if (!pane) { - return - } - const transport = paneTransportsRef.current.get(pane.id) - transport?.sendInput('\x16\x0a') - } - window.addEventListener('keydown', onKeyDown, { capture: true }) window.addEventListener('keydown', onCtrlBackspace, { capture: true }) window.addEventListener('keydown', onAltBackspace, { capture: true }) - window.addEventListener('keydown', onShiftEnter, { capture: true }) return () => { window.removeEventListener('keydown', onKeyDown, { capture: true }) window.removeEventListener('keydown', onCtrlBackspace, { capture: true }) window.removeEventListener('keydown', onAltBackspace, { capture: true }) - window.removeEventListener('keydown', onShiftEnter, { capture: true }) } }, [ isActive,