From a72bdd080875e1cdd921d7afd6376f4a227bb259 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Thu, 13 Aug 2026 11:04:53 -0700 Subject: [PATCH] fix(terminal): keep the gap reset on the warning abandon path The reset had been folded into an else of the unavailable-warning branch, so the primary abandon path relied on the marker's earlier reset still standing. It does not always: this function captures a replayingSnapshot, so it can run after a partially-applied replay has already moved the pen, and the warning itself is plain text carrying no SGR. Restore the unconditional write, guarded only against the remote re-arm which writes its own. --- .../src/components/terminal-pane/pty-connection.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/terminal-pane/pty-connection.ts b/src/renderer/src/components/terminal-pane/pty-connection.ts index b29e5d4e7ac..6ef9baa5356 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.ts @@ -7067,7 +7067,12 @@ export function connectPanePty( // backpressure must not outlive it — it would re-open recovery and banner a second time. clearHiddenOutputRestoreFloodRepaintTimer() writeRestoreUnavailableWarning() - } else if (!rearmedRemoteRestore) { + } + // Why not an else: the unavailable warning is plain text and carries no SGR + // of its own, so folding the reset into the other branch skipped it on the + // primary abandon path — the one that declares the bytes unrecoverable. + // Guarded only against the remote re-arm, which writes its own reset. + if (!rearmedRemoteRestore) { writePtyOutputToXterm(RESET_AFTER_BYTE_GAP, true) } if (hadPendingOverflow) {