[PR #12526] Enable the Terminal to tell ConPTY who the owner is #29090

Closed
opened 2026-01-31 09:32:42 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/12526

State: closed
Merged: Yes


Window shenanigans, part the first:

This PR enables terminals to tell ConPTY what the owning window for the pseudo window should be. This allows thigs like MessageBoxes created by console applications to work. It also enables console apps to use GetAncestor(GetConsoleWindow(), GA_ROOT) to get directly at the HWND of the Terminal (but don't please).

This is tested with our internal partners and seems to work for their scenario.

See #2988, #12799, #12515, #12570.

PR Checklist

  • This is 1/3 of #2988.
  • I work here

TODOS:

  • Clean up dead code, scratch, etc.
  • Especially make sure that the reparenting flow makes sense post-startup. (for tear-out, #5000. Won't be able to test now, but should work then)
  • Come up with a total list of scenarios where the z ordering is messed up
  • Sync with auth folks to see if this worked
  • merge with #12515 work
  • tests?
**Original Pull Request:** https://github.com/microsoft/terminal/pull/12526 **State:** closed **Merged:** Yes --- ## Window shenanigans, part the first: This PR enables terminals to tell ConPTY what the owning window for the pseudo window should be. This allows thigs like MessageBoxes created by console applications to work. It also enables console apps to use `GetAncestor(GetConsoleWindow(), GA_ROOT)` to get directly at the HWND of the Terminal (but _don't please_). This is tested with our internal partners and seems to work for their scenario. See #2988, #12799, #12515, #12570. ## PR Checklist * [x] This is 1/3 of #2988. * [x] I work here ### TODOS: * [x] Clean up dead code, scratch, etc. * [x] Especially make sure that the reparenting flow makes sense post-startup. (for tear-out, #5000. Won't be able to test now, but should work then) * [x] Come up with a total list of scenarios where the z ordering is messed up * [x] Sync with auth folks to see if this worked * [x] merge with #12515 work * [ ] tests?
claunia added the pull-request label 2026-01-31 09:32:42 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29090