Skip to content

fix: pr-bug-scan validated finding from #1857 - #1886

Merged
AmethystLiang merged 2 commits into
mainfrom
bot/pr-bug-scan-1857-1778815572
May 15, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
bot/pr-bug-scan-1857-1778815572

Conversation

@buf0-bot

@buf0-bot buf0-bot Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Automated fix-PR from pr-bug-scan for parent #1857.

Fixer status: FIXED_WITH_CODE_PROOF
Summary: Restored alt-buffer guards at both the double-rAF and 200ms phases of scheduleSplitScrollRestore so TUI panes skip restoreScrollState+refresh, blocking the #1298 cursor-drift regression.
Blocked proof link: src/renderer/src/lib/pane-manager/pane-split-scroll.ts:113 (post-diff 200ms timer) — alt-buffer check now early-returns before restoreScrollState/refreshAfterReparent; same guard re-added at the double-rAF phase (line 92).
Typecheck: skipped

Proof (from validator)

  • C1 — proof_type: code_analysis
    • trigger: User splits a pane while a full-screen TUI is active (alt-buffer) in the source pane
    • observable: TUI cursor drifts one row off after split; user-typed input appears one row below the TUI's expected cursor row, with residual fragments at the previous cursor position
    • path:
      • src/renderer/src/lib/pane-manager/pane-manager.ts: splitPane() captures scrollState and calls scheduleSplitScrollRestore after wrapInSplit reparents the existing container
      • src/renderer/src/lib/pane-manager/pane-split-scroll.ts:92 (post-diff): double-rAF callback unconditionally calls restoreScrollState + refreshAfterReparent when pendingSplitScrollState is set, with no alt-buffer check
      • src/renderer/src/lib/pane-manager/pane-split-scroll.ts:113 (post-diff): 200ms timeout unconditionally calls restoreScrollState(live.terminal, scrollState) and refreshAfterReparent(live), with no alt-buffer guard
      • src/renderer/src/lib/pane-manager/pane-split-scroll.ts:5 refreshAfterReparent calls pane.terminal.refresh(0, rows-1), repainting all rows from xterm's buffer mid-TUI-draw

Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.

Restored alt-buffer guards at both the double-rAF and 200ms phases of scheduleSplitScrollRestore so TUI panes skip restoreScrollState+refresh, blocking the #1298 cursor-drift regression.
@AmethystLiang
AmethystLiang self-requested a review May 15, 2026 05:17
@AmethystLiang
AmethystLiang merged commit a9b4775 into main May 15, 2026
2 checks passed
@AmethystLiang
AmethystLiang deleted the bot/pr-bug-scan-1857-1778815572 branch May 15, 2026 05:34
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix: address pr-bug-scan validated finding from stablyai#1857

Restored alt-buffer guards at both the double-rAF and 200ms phases of scheduleSplitScrollRestore so TUI panes skip restoreScrollState+refresh, blocking the stablyai#1298 cursor-drift regression.

* fix: preserve split scroll state around alternate buffers

---------

Co-authored-by: orca-bug-scan-bot <[email protected]>
Co-authored-by: Jinjing <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant