You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(floating): open the floating terminal in a separate window - #44303
The floating workspace lives inside the main Orca window, so anything that fills the main window, such as a Markdown preview, covers the agent. This adds a button that opens the floating workspace's active terminal in its own window. It is the same terminal session, not a copy.
What Changed
Before: the floating terminal can only be shown inside the main window.
After: the floating panel's controls have an "Open in separate window" button. It shows when the active floating tab is a terminal with a running PTY, and not in the paired web client. Clicking it opens that PTY in a native window and hides the panel. Clicking it again for the same PTY focuses the window that is already open. Closing the window leaves the session running, and reopening the floating workspace shows it as before.
Mechanism:
The first commit moves the dashboard pop-out's window setup (sandboxed preload, isolated partition, deny-all permissions, navigation policy, zoom and paste handling) into a shared createPopoutWindow in src/main/window/popout-window.ts. The dashboard pop-out keeps its own bounds handling and behaves as before.
The terminal window is built on that factory. It loads popout.html?surface=terminal&ptyId=…, which renders the existing AgentTerminalPreview over the existing terminalPreview IPC. There is no new terminal renderer and no new PTY data channel.
terminalPreview connect, input, ack, fit and unsubscribe accept a terminal pop-out only for the PTY it was opened for. The clipboard text check and the native selection action admit terminal pop-outs as they admit the dashboard pop-out. terminalPopout:open is accepted only from the trusted UI renderer.
Why
#22167 asks for this. Building on the dashboard pop-out's window and terminal preview keeps the change small. I sent this earlier as #39722 (2,347 lines, with a hide and dock lifecycle and an experimental setting) and #39992 on top of it. This PR is the core of #39722, cut down to one button.
Alternatives considered: moving the in-window xterm into another window (a renderer cannot hand its xterm to another one, so the PTY would have to re-attach anyway), and a full workspace window with tabs (the size of #39722).
The issue also mentions drag-to-detach. That is not in this PR.
Visual Proof
Before: the floating panel has Maximize and Minimize only. The terminal cannot leave the main window.
After:
Both images come from the background e2e run, so the OS window frame is not in them.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
I did not test it by hand. It is checked by the tests below, on macOS only.
Unit, src/main/ipc/terminal-views/terminal-preview-popout-trust.test.ts: a terminal pop-out can type into its own PTY and not into another, and an unknown sender is refused. It fails when the PTY scoping is removed.
E2E, tests/e2e/layout/window-tabs/floating-terminal-separate-window.spec.ts (background launch): clicking the button opens a window for that PTY and hides the panel, the terminal has focus, a typed command runs, and the in-window pane shows its output after the floating workspace is reopened. It passed 2 of 2 with --repeat-each=2.
pnpm check:changed: 39 of 41 checks pass. main-sync-fs-ratchet and main-blocking-helper-ratchet fail the same way on a clean origin/main (they report profile-cloud-session-store.ts), so they do not come from this branch.
Not tested on Linux, Windows, SSH or a paired remote runtime.
Risk
Level: Low
The riskiest part is that the dashboard pop-out now goes through the shared factory. Its window options, partition, title, permission handlers, zoom and paste handling moved unchanged, and its bounds save and restore stay in its own module. If this regressed, the dashboard pop-out would open with the wrong zoom or lose paste.
A terminal pop-out renderer can read and write only its own PTY. No saved data or settings change. A plain revert backs it out.
AI Disclosure
Written with Claude Code (Claude Opus 5.5).
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Size: 21 files, +523 / −196. About 170 of the added lines are moved from dashboard-popout-window.ts, and 111 are tests.
Known limits:
One window per PTY, fixed when it opens. It does not follow the floating workspace's active tab and has no tabs.
Window size and position are not remembered. The title is "Orca Terminal".
As in the dashboard's terminal preview: shorter scrollback, no search, text-only paste, and links do not open from it.
If you would rather ship it behind an experimental setting first, I can add one.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Move the companion-window setup (sandboxed preload, isolated session,
deny-all permissions, zoom follow, paste and zoom chords, localized
title) into popout-window.ts so a second pop-out kind can reuse it.
The dashboard keeps its single window, saved bounds and open/close
broadcast. The View menu zooms whichever pop-out is focused.
Add an "Open in separate window" button to the Floating Workspace.
It opens the active terminal pane in its own native window, built on
the shared pop-out setup and the dashboard's terminal preview, and
hides the in-app panel. Opening the same terminal again focuses its
window. The window may preview, type into and copy from only the PTY
it was opened for, and it closes with the main window.
Refs stablyai#22167
The change adds a shared native pop-out window implementation and uses it for terminal pop-outs keyed by PTY ID. The renderer can open the active floating-terminal tab in a separate window. Terminal preview IPC checks that a terminal pop-out sender is associated with the requested PTY. The change also updates pop-out renderer selection, clipboard text sender authorization, zoom handling, and main-window cleanup. Tests cover PTY-scoped preview authorization and the separate-window workflow.
Merge Risk: Low · up to 15591
The separate-window terminal feature looks sound and keeps PTY access scoped to each window. One minor behavior issue is shared zoom across multiple terminal pop-outs, mainly in development builds. The e2e assertion for the reopened terminal should also move to the DOM. Neither should block merge, but both are worth fixing.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(floating): open the floating terminal in a separate window" matches the main change. The PR adds an "Open in separate window" button that moves the floating workspace's active terminal…
Linked Issues check
[#22167] The core request is a separate native window for floating terminal content, with the same session kept functional. The PR adds an "Open in separate window" control in FloatingTerminalWindowCo…
Out of Scope Changes check
All changed areas connect to the terminal pop-out objective. Changes in register-core-handlers.ts, terminal-popout.ts, terminal-preview.ts, ui.ts, clipboard-ipc-sender-trust.ts, createMainWindow.ts, p…
Description check
The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue (Fixes #22167), Visual Proof, Testing, Risk level, AI Disclosure, the upstream boundary checkb…
Full details: Title check
Explanation
The title "feat(floating): open the floating terminal in a separate window" matches the main change. The PR adds an "Open in separate window" button that moves the floating workspace's active terminal PTY into a native window. The title is short, specific, and follows a conventional commit style.
Full details: Linked Issues check
Explanation
[#22167] The core request is a separate native window for floating terminal content, with the same session kept functional. The PR adds an "Open in separate window" control in FloatingTerminalWindowControls.tsx. It shows when the active floating tab has a PTY and is not in a paired web client. Selecting it calls terminalPopout:open, which calls openTerminalPopout in terminal-popout-window.ts. That function creates a window via the shared createPopoutWindow factory (popout-window.ts). The window loads popout.html?surface=terminal&ptyId=… and renders AgentTerminalPreview over the existing terminalPreview IPC, so the existing PTY session is reused. Closing the window leaves the PTY running, and reopening the floating workspace shows the pane again. Repeated opens for the same PTY reveal the existing window. The issue's proposed solution also lists drag-to-detach "if feasible" and docking back into the main window. The PR does not implement drag-to-detach, as the PR description states. It does not add a dock-back action. The reopen path after closing the window partly covers the return case. These two items are secondary to the core request and are not treated as blocking. The PR also has no manual test. Its unit test and e2e test cover the PTY scoping and the open flow on macOS only, per the PR description. Those automated tests were not re-run in this assessment.
Full details: Out of Scope Changes check
Explanation
All changed areas connect to the terminal pop-out objective. Changes in register-core-handlers.ts, terminal-popout.ts, terminal-preview.ts, ui.ts, clipboard-ipc-sender-trust.ts, createMainWindow.ts, popout.tsx, preload API files, and the terminal-popout renderer add the new window and its scoped IPC. The dashboard-popout-window.ts reduction (+14/-170) moves window setup into the shared popout-window.ts factory. The PR states this is needed so the terminal window reuses the same setup. The dashboard pop-out keeps its bounds handling. The zoom change in main-process-i18n-menu.ts (zoomPopoutIfFocused) and the clipboard and selection trust changes apply to both pop-out kinds. That is a direct consequence of the shared factory. The i18n strings, the unit test, and the e2e test support the new feature. No unrelated change was found in the summary. The refactor of the dashboard pop-out is a supporting change, and its behavior claims are not verified by this assessment beyond the PR description and summary.
Full details: Description check
Explanation
The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue (Fixes #22167), Visual Proof, Testing, Risk level, AI Disclosure, the upstream boundary checkbox, and the checklist. It explains the mechanism, the alternatives considered, the known limits, and how to back out the change. Visual proof is included as images, and the testing section names the unit and e2e tests with their results. Minor gaps: the manual-test checkbox is unchecked and the author states manual testing was not done, the Notes section from the template is replaced by a size note, and the Linked Issue section does not say the template's Notes checks (security, cross-platform, SSH, mobile) were reviewed. These gaps are not critical.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Give each terminal pop-out a separate zoom partition.
In development, open pop-outs for PTYs A and B, then zoom A. Both windows use this partition and the same ELECTRON_RENDERER_URL hostname. Electron 43.8.10 stores default zoom by hostname, so B changes too. Opening B can also reset A to the persisted app zoom. Different ptyId query values do not isolate this hostname-based zoom state. (raw.githubusercontent.com)
Use a distinct partition per PTY window. Keep the existing store subscription so explicit app-wide zoom changes still reach every pop-out.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Assert the reopened terminal output through the DOM.
serializeAddon.serialize() can contain the marker even when the reopened terminal does not render it. Panel visibility alone does not catch that failure.
Replace this model assertion with a DOM assertion for ok-${marker} inside the reopened terminal pane.
As per coding guidelines, “assert user-visible behavior through the DOM”.
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
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.
ELI5
The floating workspace lives inside the main Orca window, so anything that fills the main window, such as a Markdown preview, covers the agent. This adds a button that opens the floating workspace's active terminal in its own window. It is the same terminal session, not a copy.
What Changed
Before: the floating terminal can only be shown inside the main window.
After: the floating panel's controls have an "Open in separate window" button. It shows when the active floating tab is a terminal with a running PTY, and not in the paired web client. Clicking it opens that PTY in a native window and hides the panel. Clicking it again for the same PTY focuses the window that is already open. Closing the window leaves the session running, and reopening the floating workspace shows it as before.
Mechanism:
createPopoutWindowinsrc/main/window/popout-window.ts. The dashboard pop-out keeps its own bounds handling and behaves as before.popout.html?surface=terminal&ptyId=…, which renders the existingAgentTerminalPreviewover the existingterminalPreviewIPC. There is no new terminal renderer and no new PTY data channel.terminalPreviewconnect, input, ack, fit and unsubscribe accept a terminal pop-out only for the PTY it was opened for. The clipboard text check and the native selection action admit terminal pop-outs as they admit the dashboard pop-out.terminalPopout:openis accepted only from the trusted UI renderer.Why
#22167 asks for this. Building on the dashboard pop-out's window and terminal preview keeps the change small. I sent this earlier as #39722 (2,347 lines, with a hide and dock lifecycle and an experimental setting) and #39992 on top of it. This PR is the core of #39722, cut down to one button.
Alternatives considered: moving the in-window xterm into another window (a renderer cannot hand its xterm to another one, so the PTY would have to re-attach anyway), and a full workspace window with tabs (the size of #39722).
Linked Issue
Fixes #22167
The issue also mentions drag-to-detach. That is not in this PR.
Visual Proof
Before: the floating panel has Maximize and Minimize only. The terminal cannot leave the main window.
After:
Both images come from the background e2e run, so the OS window frame is not in them.
Testing
I did not test it by hand. It is checked by the tests below, on macOS only.
src/main/ipc/terminal-views/terminal-preview-popout-trust.test.ts: a terminal pop-out can type into its own PTY and not into another, and an unknown sender is refused. It fails when the PTY scoping is removed.tests/e2e/layout/window-tabs/floating-terminal-separate-window.spec.ts(background launch): clicking the button opens a window for that PTY and hides the panel, the terminal has focus, a typed command runs, and the in-window pane shows its output after the floating workspace is reopened. It passed 2 of 2 with--repeat-each=2.pnpm check:changed: 39 of 41 checks pass.main-sync-fs-ratchetandmain-blocking-helper-ratchetfail the same way on a cleanorigin/main(they reportprofile-cloud-session-store.ts), so they do not come from this branch.Risk
Level: Low
The riskiest part is that the dashboard pop-out now goes through the shared factory. Its window options, partition, title, permission handlers, zoom and paste handling moved unchanged, and its bounds save and restore stay in its own module. If this regressed, the dashboard pop-out would open with the wrong zoom or lose paste.
A terminal pop-out renderer can read and write only its own PTY. No saved data or settings change. A plain revert backs it out.
AI Disclosure
Written with Claude Code (Claude Opus 5.5).
Review
Agent skill upstream boundary
Notes
Size: 21 files, +523 / −196. About 170 of the added lines are moved from
dashboard-popout-window.ts, and 111 are tests.Known limits:
If you would rather ship it behind an experimental setting first, I can add one.
Checklist