[PR #14196] [MERGED] Give the root PID ownership of the pseudoconsole window #29985

Open
opened 2026-01-31 09:38:01 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14196
Author: @DHowett
Created: 10/12/2022
Status: Merged
Merged: 12/1/2022
Merged by: @undefined

Base: mainHead: dev/duhowett/looking_for_an_owner_plz_adopt_me


📝 Commits (6)

  • f0f74d7 Give the root PID owhership of the pseudoconsole window
  • ed45b29 Update src/interactivity/base/RemoteConsoleControl.cpp
  • 373f5f0 Migrate spelling-0.0.21 changes from main
  • a249b49 Merge remote-tracking branch 'origin/main' into dev/duhowett/looking_for_an_owner_plz_adopt_me
  • 60a6570 appease austinmode
  • 3c4bbaf can't runaustinmode if the code doesn't build in the open

📊 Changes

10 files changed (+46 additions, -13 deletions)

View changed files

📝 .github/actions/spelling/expect/expect.txt (+1 -0)
📝 src/interactivity/base/InteractivityFactory.cpp (+5 -3)
📝 src/interactivity/base/RemoteConsoleControl.cpp (+7 -0)
📝 src/interactivity/base/RemoteConsoleControl.hpp (+1 -0)
📝 src/interactivity/inc/IConsoleControl.hpp (+1 -0)
📝 src/interactivity/onecore/ConsoleControl.cpp (+5 -0)
📝 src/interactivity/onecore/ConsoleControl.hpp (+1 -0)
📝 src/interactivity/win32/ConsoleControl.cpp (+12 -0)
📝 src/interactivity/win32/ConsoleControl.hpp (+1 -0)
📝 src/interactivity/win32/windowio.cpp (+12 -10)

📄 Description

This is a partial fix for the Get-Credential issue. While investigating it, I found that the pseudoconsole window is not marked as being "owned" (in NTUSER) by the PID/TID of the console application that is "hosted" "in" it. Doing this does not (and cannot) fix Get-Credential failing in DefTerm scenarios.

ConsoleSetWindowOwner is one of the operations that can be done by a conhost to any window, and so the RemoteConsoleControl can call through to the Win32 ConsoleControl to pull it off.

I chose to add SetWindowOwner to the IConsoleControl interface instead of moving ConsoleControl::Control into the interface to reduce the amount of churn and better separate interface responsibilities.

References #14119


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14196 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 10/12/2022 **Status:** ✅ Merged **Merged:** 12/1/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/duhowett/looking_for_an_owner_plz_adopt_me` --- ### 📝 Commits (6) - [`f0f74d7`](https://github.com/microsoft/terminal/commit/f0f74d7a529df6b9d53a9ad41a72c8cd122e83d2) Give the root PID owhership of the pseudoconsole window - [`ed45b29`](https://github.com/microsoft/terminal/commit/ed45b29c39a583c74e0fd1f2cdaf3a5c13221c8d) Update src/interactivity/base/RemoteConsoleControl.cpp - [`373f5f0`](https://github.com/microsoft/terminal/commit/373f5f0e25138c0891757d4f0ffaa5bac851b4ba) Migrate spelling-0.0.21 changes from main - [`a249b49`](https://github.com/microsoft/terminal/commit/a249b49af31363438507ed5cc2b5fbe06b1f10e2) Merge remote-tracking branch 'origin/main' into dev/duhowett/looking_for_an_owner_plz_adopt_me - [`60a6570`](https://github.com/microsoft/terminal/commit/60a6570adab229739ce3debabb85510348ecd255) appease austinmode - [`3c4bbaf`](https://github.com/microsoft/terminal/commit/3c4bbaf1e8a36401e71ad6d1e15cd4105ff6841c) can't runaustinmode if the code _doesn't build in the open_ ### 📊 Changes **10 files changed** (+46 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/expect/expect.txt` (+1 -0) 📝 `src/interactivity/base/InteractivityFactory.cpp` (+5 -3) 📝 `src/interactivity/base/RemoteConsoleControl.cpp` (+7 -0) 📝 `src/interactivity/base/RemoteConsoleControl.hpp` (+1 -0) 📝 `src/interactivity/inc/IConsoleControl.hpp` (+1 -0) 📝 `src/interactivity/onecore/ConsoleControl.cpp` (+5 -0) 📝 `src/interactivity/onecore/ConsoleControl.hpp` (+1 -0) 📝 `src/interactivity/win32/ConsoleControl.cpp` (+12 -0) 📝 `src/interactivity/win32/ConsoleControl.hpp` (+1 -0) 📝 `src/interactivity/win32/windowio.cpp` (+12 -10) </details> ### 📄 Description This is a partial fix for the Get-Credential issue. While investigating it, I found that the pseudoconsole window is not marked as being "owned" (in NTUSER) by the PID/TID of the console application that is "hosted" "in" it. Doing this does not (and cannot) fix `Get-Credential` failing in DefTerm scenarios. ConsoleSetWindowOwner is one of the operations that can be done by a conhost to any window, and so the RemoteConsoleControl can call through to the Win32 ConsoleControl to pull it off. I chose to add SetWindowOwner to the IConsoleControl interface instead of moving ConsoleControl::Control into the interface to reduce the amount of churn and better separate interface responsibilities. References #14119 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:38:01 +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#29985