Skip to content

Misc. elevation crash fixes#12205

Merged
11 commits merged intomainfrom
dev/migrie/b/12169-elevate-jumplist-crash
Jan 24, 2022
Merged

Misc. elevation crash fixes#12205
11 commits merged intomainfrom
dev/migrie/b/12169-elevate-jumplist-crash

Conversation

@zadjii-msft
Copy link
Member

This is a collection of fixes:

checklist

(cherry picked from commit 5614fde95f927428a6acc38baeea64588953c2a5)
I think this is a fix for #12190 intentionally, and for #12169 by happenstance.
I'm no longer creating the window when the actions at the commandline are just creating new tabs or panes that need to be elevated.

I still have more to check here. For ex:

```
wtd nt -p admin ; sp -p admin ; sp -p foo
```

That... should create a new tab then split that with foo, right? Unsure if that'll work

* [ ] fix that
* [ ] I don't think I need HookupKeyBindings
@ghost ghost added Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree. Severity-Crash Crashes are real bad news. labels Jan 20, 2022
@github-actions

This comment has been minimized.

@ianjoneill
Copy link
Contributor

I've checked out and built this branch and can no longer reproduce the crash in #12169 🎉.

@zadjii-msft
Copy link
Member Author

@ianjoneill thanks for going the extra mile to confirm! (and also for selfhosting directly on main 😄)

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a very thorny area in which we're gonna continue seeing issues -- let's monitor.

@DHowett DHowett added the Needs-Second It's a PR that needs another sign-off label Jan 21, 2022
Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but some nits.

// - <none>
// Return Value:
// - <none>
bool TerminalPage::ShouldImmediatelyHandoffToElevated(CascadiaSettings& settings) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to need a mutable reference to settings. Make it a const ref?
Same for the one below.

Comment on lines +306 to +309
// - This is a bit of trickiness: If we're running unelevated, and the user
// passed in only --elevate actions, the we don't _actually_ want to
// restore the layouts here. We're not _actually_ about to create the
// window. We're simply going to toss the commandlines
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so I get it: This returns true if we're not elevated but all relevant pane-spawning actions are elevated. Is that correct? Would such a comment be helpful for others in the future?

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 24, 2022
@ghost
Copy link

ghost commented Jan 24, 2022

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 43a275c into main Jan 24, 2022
@ghost ghost deleted the dev/migrie/b/12169-elevate-jumplist-crash branch January 24, 2022 23:32
ghost pushed a commit that referenced this pull request Jan 27, 2022
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.
DHowett pushed a commit that referenced this pull request Feb 18, 2022
@ghost
Copy link

ghost commented Mar 25, 2022

🎉Windows Terminal v1.12.1073 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Area-Windowing Window frame, quake mode, tearout AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Second It's a PR that needs another sign-off Priority-0 Bugs that we consider release-blocking/recall-class (P0) Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree. Severity-Crash Crashes are real bad news.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starting an elevated profile from the jumplist will relaunch persisted unelevated windows Crash opening an elevated profile from the taskbar jumplist

4 participants