From 007f4e46fae98fc46fb5bb5f14e6a897af8ace77 Mon Sep 17 00:00:00 2001 From: m4air Date: Tue, 15 Sep 2026 18:02:53 -0700 Subject: [PATCH] fix(renderer): release scroll intents on worktree removal --- .../terminal-pane/terminal-parked-watcher-registry.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/terminal-parked-watcher-registry.ts b/src/renderer/src/components/terminal-pane/terminal-parked-watcher-registry.ts index 70d2bc3e2e6..020421e637c 100644 --- a/src/renderer/src/components/terminal-pane/terminal-parked-watcher-registry.ts +++ b/src/renderer/src/components/terminal-pane/terminal-parked-watcher-registry.ts @@ -225,6 +225,11 @@ export function pruneParkedTerminalWatchers(liveWorktreeIds: ReadonlySet } for (const [tabId, capture] of capturedPanesByTabId) { if (!liveWorktreeIds.has(capture.worktreeId)) { + for (const pane of capture.panes) { + // Worktree removal can bypass closeTab while panes are parked; release + // the same strong scroll-intent keys as explicit tab retirement. + releaseTerminalScrollIntentKey(pane.leafId) + } capturedPanesByTabId.delete(tabId) } }