Skip to content

ui: extend console parenting beyond MSAL - #2465

Merged
mjcheetham merged 2 commits into
git-ecosystem:mainfrom
mjcheetham:parent-windowing-v2
Oct 5, 2026
Merged

mjcheetham merged 2 commits into
git-ecosystem:mainfrom
mjcheetham:parent-windowing-v2

Conversation

@mjcheetham

Copy link
Copy Markdown
Contributor

This follows up on #2464.

Visible-console parenting currently lives inside the MSAL adapter, so other in-process authentication dialogs remain unparented unless GCM_MODAL_PARENTHWND is supplied. Those prompts can appear disconnected from the terminal that initiated the Git operation.

This PR moves console-parent discovery into a shared platform helper and uses it in the authentication and UI-helper parent handle lookups. This extends the fallback beyond MSAL while keeping the two lookup paths consistent. MSAL retains responsibility for creating a progress window when broker authentication requires a parent and no usable handle was resolved.

Explicit HWNDs still take precedence and are not visibility-filtered. Automatically discovered owners must be visible, with visibility checked after resolving the console's root owner to accommodate ConPTY compatibility windows.

Update the environment variable documentation to describe the fallback to the console-parent window.

Tested behaviour on Windows Terminal, conhost.exe (classic terminal host), and Git Bash/MSYS2's terminal.

Console parenting currently lives inside the MSAL adapter, so other
in-process authentication dialogs do not benefit from the visible
terminal owner. Those prompts can appear disconnected from the Git
operation that opened them.

Resolve the parent at the shared authentication boundary so all
in-process prompts follow the same policy. Explicit handles retain
precedence, hidden console owners are ignored, and minimised owners
remain eligible.

Keep progress-window creation in the MSAL adapter: it is a fallback
for broker flows that require a parent, not a default owner for
ordinary authentication dialogs.

Assisted-by: Claude Sonnet 5
Assisted-by: GPT-6.1 Sol
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Helper commands resolve their parent handle independently of the
in-process authentication path. Keeping only the explicit-HWND case
would leave their default parent-selection policy inconsistent with
the shared authentication lookup.

Use the same visible-console fallback when no handle is configured.
Explicit handles still take precedence, and a missing or hidden
console leaves the parent unset.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
@mjcheetham
mjcheetham requested a review from a team as a code owner October 5, 2026 16:05
@mjcheetham
mjcheetham requested a review from dscho October 5, 2026 16:05
@mjcheetham mjcheetham added platform:windows Specific to the Windows platform gui Specific to graphical user interface controls labels Oct 5, 2026
@mjcheetham
mjcheetham merged commit f55797b into git-ecosystem:main Oct 5, 2026
26 checks passed
@mjcheetham
mjcheetham deleted the parent-windowing-v2 branch October 5, 2026 16:48
@mjcheetham mjcheetham mentioned this pull request Oct 6, 2026
mjcheetham added a commit that referenced this pull request Oct 6, 2026
**Bug Fixes:**

- Prompt for default OS account on Microsoft DevBox (#2459)
- Restore Entra broker parent window handling (#2464)

**Features:**

- Support `authtype` Git capability (#2457)
- Add console parent window parenting for non-Entra UI (#2465)

**Other changes:**

- Drop Windows x86 release binaries (#2456)
- Documentation updates (#2460)
- Fix release workflow _VERSION_ file parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gui Specific to graphical user interface controls platform:windows Specific to the Windows platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants