diff --git a/src/renderer/src/components/reopen-closed-workspace-tab.ts b/src/renderer/src/components/reopen-closed-workspace-tab.ts index 9c48bde624f..94fd4259b4f 100644 --- a/src/renderer/src/components/reopen-closed-workspace-tab.ts +++ b/src/renderer/src/components/reopen-closed-workspace-tab.ts @@ -12,7 +12,7 @@ export function reopenClosedWorkspaceTab(activeWorktreeId: string | null): void return } if (!activeWorktreeId) { - // History entries may be folder workspace keys; this is the activator history replay uses. - activateAndRevealWorkspace(worktreeId) + // Same activation as history replay: entries may be folder workspace keys, and this is a user open. + activateAndRevealWorkspace(worktreeId, { navigationIntent: 'user-open' }) } } diff --git a/src/renderer/src/components/terminal-workspace-keydown.test.ts b/src/renderer/src/components/terminal-workspace-keydown.test.ts index 9365ca6de9d..80cee970742 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.test.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.test.ts @@ -259,7 +259,9 @@ describe('reopen closed tab from the welcome screen', () => { }) act(() => window.dispatchEvent(event)) expect(reopenClosedTab).toHaveBeenCalledExactlyOnceWith(worktreeId) - expect(activateAndRevealWorkspace).toHaveBeenCalledExactlyOnceWith(worktreeId) + expect(activateAndRevealWorkspace).toHaveBeenCalledExactlyOnceWith(worktreeId, { + navigationIntent: 'user-open' + }) expect(event.defaultPrevented).toBe(true) }) }) diff --git a/src/renderer/src/components/terminal-workspace-keydown.ts b/src/renderer/src/components/terminal-workspace-keydown.ts index 177ac9c5e74..b7c46169f85 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.ts @@ -50,6 +50,10 @@ export function handleTerminalWorkspaceKeyDown( mobileEmulatorEnabled, terminalShortcutPolicy } = controller + // Let the focused Settings recorder capture shortcuts without executing them. + if (event.target instanceof Element && event.target.closest('[data-shortcut-recorder-active]')) { + return + } const context = getKeybindingContext(event.target) const floatingWorkspaceFocused = isEventTargetInsideFloatingWorkspacePanel(event.target) || isFloatingWorkspacePanelFocused()