Skip to content

Create Orca CLI terminals without stealing focus - #1707

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/orchestration-improve-1
May 12, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/orchestration-improve-1

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make orca terminal create create a visible terminal tab in the target worktree by default without switching the active worktree or active tab
  • keep orca terminal create --focus as the explicit focus-stealing path
  • keep spawned terminal handles usable for read/send/wait/show/close, including a background fallback if renderer tab adoption is unavailable after spawn
  • make plain CLI worktree creation non-activating while still creating the first terminal in the new worktree
  • preserve normal worktree setup behavior for CLI creates: repo setup policy still controls setup hooks; --run-hooks forces setup and activation
  • add renderer adoption support for existing PTYs without duplicating tabs on repeated switch
  • prevent terminal active-tab repair from stealing focus from editor/browser views when inactive CLI tabs are inserted
  • keep worktree creation successful if post-create terminal spawn fails, returning a warning instead of reporting that git creation failed
  • keep runtime-created PTY handles usable across renderer graph loss/reload

Verification

  • subagent review pass 1: 3 reviewers found the same post-spawn adoption failure mode; fixed with best-effort adoption and background-handle fallback
  • subagent review pass 2: found stale CLI help and terminal repair focus-steal edge case; both fixed
  • final subagent review: found post-worktree terminal spawn failure handling and runtime PTY handle durability gaps; both fixed
  • pnpm vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts -t "runtime-created PTY handles|terminal creation fails|normal setup policy|first terminal|activates CLI-created|visible terminal|inactive tab adoption"
  • pnpm vitest run --config config/vitest.config.ts src/cli/index.test.ts src/renderer/src/lib/worktree-activation.test.ts src/renderer/src/components/terminal/active-terminal-repair.test.ts src/renderer/src/hooks/useIpcEvents.test.ts
  • pnpm run tc:node
  • pnpm run tc:web
  • pnpm run build:cli
  • Electron E2E with out/bin/orca-dev: default terminal create added a visible tab in the target worktree while preserving the previously active tab/worktree
  • Electron E2E with out/bin/orca-dev worktree create: non-activated worktree create left the active worktree unchanged, created Terminal 1, and when repo setup policy applied, created an inactive Setup terminal with the generated setup runner

Note: local shell is Node v25.9.0 while the repo requests Node 24; targeted suites passed under the available runtime.

Made with Orca 🐋

@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/orchestration-improve-1 branch 3 times, most recently from 3b4d39b to 8e51815 Compare May 12, 2026 04:32
@Jinwoo-H Jinwoo-H changed the title Support background Orca CLI terminals Create Orca CLI terminals without stealing focus May 12, 2026
@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/orchestration-improve-1 branch 4 times, most recently from 42176ad to b75c559 Compare May 12, 2026 06:07
@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/orchestration-improve-1 branch from b75c559 to 66fdf4e Compare May 12, 2026 06:09
@Jinwoo-H
Jinwoo-H merged commit 8209083 into main May 12, 2026
7 checks passed
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