From 5063d3c850f893574758b4295438d8e5d73784f5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 16 Jun 2026 16:41:07 -0700 Subject: [PATCH 1/2] Fix hidden synchronized output state --- .../src/components/terminal-pane/pty-connection.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/pty-connection.ts b/src/renderer/src/components/terminal-pane/pty-connection.ts index 42178124a25..a84e2bef756 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.ts @@ -791,6 +791,7 @@ export function connectPanePty( let pendingTerminalBellNotification = false let reattachIdleAgentCursorResetTimer: ReturnType | null = null let synchronizedForegroundOutputActive = false + let synchronizedHiddenOutputActive = false // Why: idle callbacks are registered before the deferred PTY output plumbing // exists. Start with the shared scheduler, then switch to the PTY writer // below so hidden-tab resets keep backlog-recovery callbacks and byte order. @@ -3017,6 +3018,12 @@ export function connectPanePty( } writePtyOutputToXterm(rendererData, foreground) } + if (!foreground) { + synchronizedHiddenOutputActive = shouldSynchronizedOutputRemainActive( + data, + synchronizedHiddenOutputActive + ) + } schedulePendingStartupCommandDelivery() } From c4580fe1aa4d760215ecd8b1a3f197963c0d62f0 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 16 Jun 2026 16:46:40 -0700 Subject: [PATCH 2/2] Add hidden startup query window helper --- src/renderer/src/components/terminal-pane/pty-connection.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/pty-connection.ts b/src/renderer/src/components/terminal-pane/pty-connection.ts index 96467390bc7..742e5bba600 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.ts @@ -2441,6 +2441,10 @@ export function connectPanePty( // hidden xterm is dirty, skipping is safer than sending stale CPR/DECRQM. } + function isHiddenStartupRendererQueryWindowActive(): boolean { + return shouldSnapshotHiddenCodexOutput && hiddenStartupRendererQueryPending.length > 0 + } + function takeHiddenStartupRendererQueryPendingForForeground(data: string): { statelessQueryData: string statefulQueryData: string