Repository navigation
fix(terminal): prevent dead terminal after split via WebGL lifecycle and worktree dedup - #1298
Merged
Merged
Conversation
…attach and worktree dedup Two root causes for intermittent blank terminals after setup-script splits: 1. WebGL context invalidation during DOM reparent — wrapInSplit() detaches and reattaches the existing pane's container, which can silently kill the WebGL context (Chromium reclaims oldest context near its ~8-16 limit without firing contextlost). Fix: dispose WebGL before the DOM move, reattach in the 200ms scheduleSplitScrollRestore timer. Same pattern applied to insertPaneNextTo (drag-drop reorder). 2. Duplicate worktree entries causing React key collision — race between createWorktree (appends unconditionally) and file-watcher/poll triggering fetchWorktrees (replaces array with list that already includes the new worktree). Fix: check for existing entry before appending, plus belt-and-suspenders dedup in the useAllWorktrees selector. Also adds diagnostic health check (1s after split) to detect dead terminals in the field — only flags when buffer has data but serialize() is empty. Co-authored-by: Orca <[email protected]>
…helper Co-authored-by: Orca <[email protected]>
… fit max-lines Co-authored-by: Orca <[email protected]>
mralexsaavedra
pushed a commit
to mralexsaavedra/orca
that referenced
this pull request
May 2, 2026
…and worktree dedup (stablyai#1298) Co-authored-by: Orca <[email protected]>
Jinwoo-H
added a commit
that referenced
this pull request
May 3, 2026
Resolved conflicts across shared settings, preload APIs, runtime RPC, and the experimental settings pane. Kept both the Mobile Pairing feature (HEAD) and the Sidekick feature (main) as sibling experimental entries, with Orchestration shifting to index 3 in EXPERIMENTAL_PANE_SEARCH_ENTRIES. Extracted HiddenExperimentalGroup and SupportedAgentsDisclaimer from ExperimentalPane.tsx into their own files to stay under the 400-line oxlint cap after the merge increased the file size. In pane-tree-ops.ts, kept main's PR #1298 WebGL reattach logic (moved to pane-split-scroll.ts) and dropped HEAD's inline pendingSplitScrollState workaround. Kept the mobile-fit-override lookup from HEAD. In runtime-rpc.ts, kept main's sweepOrphanedRuntimeSockets startup call alongside HEAD's WebSocket transport. Renamed singular transport field to transports array in runtime-metadata.test.ts fixtures. In orca-runtime.ts, merged main's getEffectiveHooks(repo, worktreePath) signature with HEAD's setupDecision/shouldRunSetupForCreate logic. In pty.ts, preserved HEAD's semantics of notifying runtime?.onPtyData before the isDestroyed() check so mobile clients still receive data when the desktop window is closed. Co-authored-by: Orca <[email protected]>
4 of 6 tasks
nwparker
pushed a commit
that referenced
this pull request
May 14, 2026
… TUI cursor drift (#1413) PR #1298 schedules scroll-restore + terminal.refresh(0, rows-1) at ~32ms and 200ms after a split to preserve scrollback through DOM reparenting. When a full-screen TUI (Claude Code, vim, less) is drawing at that moment, forceViewportScrollbarSync's scrollLines(-1)/(+1) jiggle and the buffer repaint race the TUI's next write — the TUI's cursor lands one row below where it expects and a residual fragment is left at the old row. Alt-buffer has no scrollback, so scroll restore has nothing legitimate to do there. Gate the restore + refresh behind buffer.active.type, but keep the WebGL reattach callback firing so #1298's dead-canvas fix is preserved. Normal-buffer splits are unchanged. Bisected against origin/main: bug appears at b4f1f0e (#1298), absent at its parent be0e3c2. Co-authored-by: Orca <[email protected]>
AmethystLiang
added a commit
that referenced
this pull request
May 15, 2026
* fix: address pr-bug-scan validated finding from #1857 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. * fix: preserve split scroll state around alternate buffers --------- Co-authored-by: orca-bug-scan-bot <[email protected]> Co-authored-by: Jinjing <[email protected]>
aashishtamsya
added a commit
to aashishtamsya/orca
that referenced
this pull request
Jul 24, 2026
…ab switch Previously, restoreScrollStateNow returned 'skipped' for any terminal in alternate buffer mode (OMP, vim, htop, etc.), so scroll position was always lost when switching tabs and returning. Now restores viewport Y directly via scrollToLine for alternate buffers — safe because tab switches have no active draw race. The split-reparent path (scheduleSplitScrollRestore) still defers alternate buffers to guard against stablyai#1298.
1 of 4 tasks
This was referenced Aug 4, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…and worktree dedup (stablyai#1298) Co-authored-by: Orca <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
… TUI cursor drift (stablyai#1413) PR stablyai#1298 schedules scroll-restore + terminal.refresh(0, rows-1) at ~32ms and 200ms after a split to preserve scrollback through DOM reparenting. When a full-screen TUI (Claude Code, vim, less) is drawing at that moment, forceViewportScrollbarSync's scrollLines(-1)/(+1) jiggle and the buffer repaint race the TUI's next write — the TUI's cursor lands one row below where it expects and a residual fragment is left at the old row. Alt-buffer has no scrollback, so scroll restore has nothing legitimate to do there. Gate the restore + refresh behind buffer.active.type, but keep the WebGL reattach callback firing so stablyai#1298's dead-canvas fix is preserved. Normal-buffer splits are unchanged. Bisected against origin/main: bug appears at 9ad7206 (stablyai#1298), absent at its parent 73b65c7. Co-authored-by: Orca <[email protected]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wrapInSplit()andinsertPaneNextTo()reparent pane containers, which can silently invalidate WebGL contexts (Chromium reclaims oldest context near its ~8–16 limit without firingcontextlost). Now disposes WebGL before the DOM move and reattaches after layout settles (200ms timer).createWorktree()appended the new worktree unconditionally, but the file watcher / 3s poll can triggerfetchWorktrees()between the backend creating the worktree and the callback running — producing duplicate entries. Now checks before appending, plus belt-and-suspenders dedup in theuseAllWorktreesselector.[split-diag] DEAD TERMINAL1s after split when the buffer has data butserialize()is empty (true dead terminal, not slow PTY spawn).Test plan
[split-diag]logs — should showhealthyorno content yet, neverDEAD TERMINALMade with Orca 🐋