Skip to content

fix(terminal): force WebGL repaint after split when dimensions match - #1272

Merged
Jinwoo-H merged 3 commits into
mainfrom
Jinwoo-H/daemon-issue-3-fix
Apr 30, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
Jinwoo-H/daemon-issue-3-fix

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix dead terminal after setup split: safeFit() had a dimension-matching early-return that skipped fitAddon.fit() during pending splits — leaving the WebGL canvas stale after wrapInSplit() reparented the DOM. Now forces fitAddon.fit() + terminal.refresh() when pendingSplitScrollState is set, even when dimensions match.
  • Suppress noisy "no live transport" warning: Added a 10s grace period after tab registration before logging the "saved PTY but no live transport" anomaly. The warning was firing on every mount because PTY spawn/attach is async — now it only warns if the transport is genuinely stuck.
  • Add debugLabel to PaneManager: Logs now include tab:<id>/wt:<id> so safeFit warnings can be correlated to specific worktrees.
  • Add headful E2E stress tests: 5 @headful test scenarios exercising the real setup-split flow with WebGL active — basic split, switch-back, rapid multi-worktree switching, forced WebGL context loss, and rapid switching during split lifecycle.

Context

The dead terminal bug manifests as blank/unresponsive terminal panes after creating a worktree with a setup split. The PTY is alive (typing accepted), but the WebGL canvas never repaints. Cmd+R fixes it by replaying the daemon snapshot. Console logs show [terminal] safeFit early-return during pending split for pane 1 — dims 136×89 match current, webgl: true confirming the early-return codepath fires in production with WebGL active.

Test plan

  • Unit tests: npx vitest run src/renderer/src/lib/pane-manager (30/30 pass)
  • Headful E2E: SKIP_BUILD=1 pnpm run test:e2e:headful (5/5 pass)
  • Manual: create workspace from GitHub issue, verify no dead terminal pane
  • Manual: verify "no live transport" warning no longer spams on normal worktree creation

Made with Orca 🐋

Jinwoo-H and others added 3 commits April 30, 2026 01:50
safeFit() had a dimension-matching optimization that early-returned
without calling fitAddon.fit() during pending splits. When the proposed
terminal dimensions happened to match the current dimensions (common at
certain window sizes), the WebGL canvas was left stale after
wrapInSplit() reparented the DOM — producing blank "dead" terminal panes.

Now forces fitAddon.fit() + terminal.refresh() when
pendingSplitScrollState is set, even when dimensions match.

Also:
- Add debugLabel (tab/worktree ID) to PaneManager for log correlation
- Suppress noisy "no live transport" warning during initial 10s PTY
  connection grace period
- Add headful E2E stress tests exercising the real setup-split flow
  with WebGL active, forced context loss, and rapid switching

Co-authored-by: Orca <help@stably.ai>
The debugLabel field was added to ManagedPaneInternal but the test
mock factories were not updated, causing typecheck failures in CI.

Co-authored-by: Orca <help@stably.ai>
The orca.yaml added to global-setup.ts caused the worktree.spec.ts
"creates a worktree through the composer UI" test to fail — the setup
script now fires on every worktree creation, breaking timing assumptions.
Scope it to the dead-terminal specs that actually need it.

Co-authored-by: Orca <help@stably.ai>
@Jinwoo-H
Jinwoo-H merged commit 066c245 into main Apr 30, 2026
2 checks passed
mralexsaavedra pushed a commit to mralexsaavedra/orca that referenced this pull request May 2, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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