feat(terminal): implement detached window terminal pop-out#6485
Draft
wolfiesch wants to merge 3 commits into
Draft
feat(terminal): implement detached window terminal pop-out#6485wolfiesch wants to merge 3 commits into
wolfiesch wants to merge 3 commits into
Conversation
aa82a77 to
c1fe0f2
Compare
- Create main-process registries for detached windows, trusted renderers, and pane ownership. - Secure IPC routing and broadcasts by scoping PTY commands and window events. - Implement window coordinator for creation, focusing, snapshot validation, and cleanup. - Add detached preload APIs and branched renderer shell with Zustand state hydration. - Wire context menu action for 'Open in New Window'.
Detached windows hide native chrome (hiddenInset on macOS, frameless on Windows/Linux), leaving no OS drag handle. Add a renderer-owned drag strip above the terminal; the terminal surface stays no-drag so xterm keeps pointer selection and focus.
- Extract snapshot validation/authorization into detached-terminal-snapshot-validation.ts to clear max-lines. - Localize the 'Open in New Window' menu item and detached shell aria-labels; sync locale catalogs. - Allowlist the detached_terminal_tab_unavailable error code (machine error string, not user copy).
c1fe0f2 to
16585f6
Compare
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
Implement a new feature allowing users to detach terminal tabs into standalone, platform-native secondary windows ("Open in New Window" context menu action). The main window remains the PTY lifecycle owner, while detached windows subscribe to
pty:dataand route PTY controls through a main-process capability and ownership verification layer.Screenshots
Pending visual proof for the window menu option and detached window display. Terminal output itself is unchanged. Keep draft until that recording or screenshot evidence is attached.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildTargeted verification:
pnpm run typecheck(Passed)pnpm --filter @stablyai/terminal testpnpm run test:e2e -- tests/e2e/tabs-detached.spec.ts(Passed)AI Review Report
The code review checked:
detachedTerminal:openWindowto focus an already open pop-out.Security Audit
pty) and direct ownership of the requested PTY in the pane registry.detachedTerminal:openWindowvalidates the entire tab layout and PTY bindings in the main process before creating the window or transferring ownership.detachedTerminal:closeWindowto prevent unrelated renderers from closing target windows.Notes
X handle: @wolfie_