[PR #12272] [MERGED] Fix defterm in wake of auto-elevation #28941

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12272
Author: @zadjii-msft
Created: 1/27/2022
Status: Merged
Merged: 1/27/2022
Merged by: @undefined

Base: mainHead: dev/migrie/b/12267-i-broke-defterm


📝 Commits (3)

  • 8c63612 This is a simple part of the fix, but not everything
  • 8eee18e Make this less noisy
  • c64df2d Yep this'll do it

📊 Changes

2 files changed (+26 additions, -17 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalPage.cpp (+9 -2)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+17 -15)

📄 Description

There are a couple places where we now bail immediately on startup, if we think the window is going to get created without any tabs. We do that to prevent a blank window from flashing on the screen when launching auto-elevate profiles. Unfortunately, those broke defterm in a particularly hard to debug way. In the defterm invocation, there actually aren't any tabs when the app completes initialization. We use the initialization to actually accept the defterm handoff. So what would happen is that the window would immediately close itself gracefully, never accepting the handoff.

In my defense, #8514, the original auto-elevated PR, predates defterm merging (906edf7) by a few months, so I totally forgot to test this when rolling it into the subsequent iterations of that PR.

Includes a semi-related code fix to #10922 to make that quieter. That is perpetually noisy, and when trying to debug defterm, you've only got about 30s to do that before it bails, so the sxe eh breaks in there are quite annoying.


🔄 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/12272 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 1/27/2022 **Status:** ✅ Merged **Merged:** 1/27/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/12267-i-broke-defterm` --- ### 📝 Commits (3) - [`8c63612`](https://github.com/microsoft/terminal/commit/8c63612967d1ac8c905387a4157f5233bbb57176) This is a simple part of the fix, but not everything - [`8eee18e`](https://github.com/microsoft/terminal/commit/8eee18e37dc457e776a1b916828cb4af42b48939) Make this less noisy - [`c64df2d`](https://github.com/microsoft/terminal/commit/c64df2d2c60f0e60474a58500232f2584b8e32a2) Yep this'll do it ### 📊 Changes **2 files changed** (+26 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+9 -2) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+17 -15) </details> ### 📄 Description There are a couple places where we now bail immediately on startup, if we think the window is going to get created without any tabs. We do that to prevent a blank window from flashing on the screen when launching auto-elevate profiles. Unfortunately, those broke defterm in a particularly hard to debug way. In the defterm invocation, there actually aren't any tabs when the app completes initialization. We use the initialization to actually accept the defterm handoff. So what would happen is that the window would immediately close itself gracefully, never accepting the handoff. In my defense, #8514, the original auto-elevated PR, predates defterm merging (906edf7) by a few months, so I totally forgot to test this when rolling it into the subsequent iterations of that PR. * Related to: * #7489 * #12137 * #12205 * [x] Closes #12267 * [x] I work here * [ ] No tests on this code unfortunately * [x] Tested manually Includes a semi-related code fix to #10922 to make that quieter. That is perpetually noisy, and when trying to debug defterm, you've only got about 30s to do that before it bails, so the `sxe eh` breaks in there are quite annoying. --- <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:31:47 +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#28941