Conversation
```
git diff dev/migrie/f/non-terminal-content-elevation-warning dev/migrie/f/632-on-warning-dialog > ..\632.patch
git apply ..\632.patch --ignore-whitespace --reject
```
|
@carlos-zamora and @miniksa, you both signed off on #11310 last time. This should be the same, so it should be an easy s/o. |
carlos-zamora
left a comment
There was a problem hiding this comment.
Just want an answer on the sln changes. I think you may want to remove the AuditMode and Fuzzing ones.
Other than that, looks great! I'll approve assuming you'll come back and fix that.
miniksa
left a comment
There was a problem hiding this comment.
Yeah this seems familiar. Let's do it.
To match the arg in #12137. `--elevate` will manually elevate the profile. `--no-elevate` will override a `elevate: true` in the profile with false. So now you can `wt --elevate cmd` and it'll do what you think * [x] I work here * [x] Tests added * [ ] need to update docs
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentdeconstructed devicefamily guardxfg pgorepro pgort PGU Timeline timelines xfgTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the [email protected]:microsoft/terminal.git repository ✏️ Contributor please read thisBy default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
See the 🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉 🗜️ If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to a Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
|
Hello @zadjii-msft! Because this pull request has the 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 (
|
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.
|
🎉 Handy links: |
Summary of the Pull Request
This is the resurrection of #8514 and #11310. WE determined that we didn't want to do #11308 after all, so this should be profile auto-elevation, without the warning.
This PR adds two features:
elevate: boolproperty to profileselevateis set totrue, then instead of opening a new tab, we'll open an elevated Terminal window with the profile.elevate:false.elevate:falsebasically just means "do nothing special with me".elevate: bool?property toNewTerminalArgs(newTab,splitPane)elevate:null(the default) does not change the profile's elevation status. The action will use whatever is set by the profile.elevate:truewill attempt to auto-elevate the profileelevate:falsewill do nothing special.References
PR Checklist
Detailed Description of the Pull Request / Additional comments
After playing with de-elevation a bit, it turns out it behaves weirdly with packaged applications. I can try and ask
explorer.exeto launch the process on our behalf. However, if the thing we're launching is an execution alias (wt.exe), and we're elevated, then the child process will still launch elevated.There's also something super BODGEY at work here.
ShellExecuteis the function we use to ask the OS to elevate something for us. ButShellExecuteneeds to be able to send a window message to the process that called it (if the caller was a WINDOWS subsystem application). So if we die immediately after callingShellExecute, then the elevated process never actually spawns - sad. So we're adding a helper process,elevate-shim.exe, that lives in our process. That'll be the one that actually callsShellExecute, so that it can live for the duration of the UAC prompt.Validation Steps Performed
Some settings to use for testing
Details
Also try:
wtd nt -p "elevated cmd" ; sp -p "elevated cmd"wtd nt -p "elevated cmd" ; nt -p "elevated cmd"This was merged manually via