Repository navigation
Parent ConPTY console windows to the Dormouse window on Windows - #1394
Merged
Merged
Conversation
A dialog a console program owns by its console window's root owner (MSAL sign-in, Connect-AzAccount) had no tie to Dormouse and fell behind it on the first click. Rust now hands each PTY's window HWND to node-pty's setParentWindow at spawn, and again where a Workspace transfer settles (adoption or hand-back). A recovery thread re-enables a window left disabled by a dialog whose process died (microsoft/node-pty#996), shell or child. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
2219c8a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9143ddcc.mouseterm.pages.dev |
| Branch Preview URL: | https://conpty-reparenting.mouseterm.pages.dev |
dormouse-bot
left a comment
Collaborator
There was a problem hiding this comment.
No findings on the code. I'm holding the approval only because the description's "Before merging" item is still unchecked: the real WAM sign-in test (Connect-AzAccount / az login opening its picker above Dormouse, owned by the pane's window). That test also covers something the MessageBoxW probe can't: whether WAM's picker counts as an owned visible window to the recovery walk, so the 1 s re-enable never fires while the picker is up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nedtwigg
force-pushed
the
conpty-reparenting
branch
from
October 27, 2026 16:50
7f5d93c to
2219c8a
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.
On Windows, a dialog that a terminal program opens owned by its console window's root owner (MSAL/WAM sign-in, e.g.
Connect-AzAccount) had no tie to Dormouse: ConPTY's hidden console window has no owner, so the first click into Dormouse buried the dialog behind it. This uses node-pty'ssetParentWindow(microsoft/node-pty#995, already in our pinned 1.2.0-beta.18) so the window holding a PTY owns its console window — the same mechanism VS Code's integrated terminal turned on by default in microsoft/vscode#342784.What changes
pty:spawn; the sidecar callssetParentWindowin the same tick, before the shell launches. A webview cannot supply a handle, it is never persisted, and a refusal is logged without blocking the terminal.pty:parentWindowline re-parents atadopt_done(to the target) and at every hand-back (to the source) — never at a transfer's start, when a tear-out's window does not exist yet.window.nativeHandle), recorded under## Futureindocs/specs/standalone.md.Spec:
docs/specs/standalone.md→ "Console window parenting", evidence in its rationale.Tested in a real Tauri dev build (Windows 11)
Using
standalone/scripts/conpty-dialog-probe.ps1(aMessageBoxWowned byGetAncestor(GetConsoleWindow(), GA_ROOTOWNER)):main; only the owner is disableddor kill) with dialog upHand-back is pinned by a source-scan test rather than driven live. Known tradeoffs (as in VS Code): the modal locks its whole window while open, and after a dead dialog Windows hands foreground to another app, so the user clicks back in.
Before merging
Connect-AzAccount(oraz login) in a dev build opens its picker above Dormouse, owned by the pane's window.🤖 Generated with Claude Code
Verified:
Connect-AzAccountin a dev build opened its account picker above Dormouse and signed in.