Setting Defaults to Run this profile as Administrator in SUI won't launch un-elevated profiles #16565

Closed
opened 2026-01-31 05:15:51 +00:00 by claunia · 2 comments
Owner

Originally created by @elsaco on GitHub (Feb 1, 2022).

Windows Terminal version

main fbe0416

Windows build number

10.0.19044.0

Other Software

No response

Steps to reproduce

  • build and deploy latest CascadiaPackage
  • toggle Run this profile as Administrator for Defaults to On . It will set it for all the other profiles, also.
  • select one profile and toggle the setting to Off
  • launch the un-elevated profile

Sample SUI screenshot:

wt_elevate_defaults

Expected Behavior

  • new un-elevated terminal window

Actual Behavior

  • any profile is launched in same window and elevated, even the ones with "elevate": false set.

Sample screenshot with CMD profile set to un-elevated:

wt_cmd_not_elevated_profile

settings.json with CMD not elevated:

    "profiles": 
    {
        "defaults": 
        {
            "elevate": true,
            "startingDirectory": "C:\\"
        },
        "list": 
        [
            {
                "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "hidden": false,
                "name": "Windows PowerShell"
            },
            {
                "commandline": "%SystemRoot%\\System32\\cmd.exe",
                "elevate": false,
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "hidden": false,
                "name": "Command Prompt"
            },

It works the other way around. If some profile is set to be elevated a new terminal window pops-up with admin rights.

Originally created by @elsaco on GitHub (Feb 1, 2022). ### Windows Terminal version main fbe0416 ### Windows build number 10.0.19044.0 ### Other Software _No response_ ### Steps to reproduce - build and deploy latest `CascadiaPackage` - toggle `Run this profile as Administrator` for `Defaults` to `On` . It will set it for all the other profiles, also. - select one profile and toggle the setting to `Off` - launch the un-elevated profile Sample SUI screenshot: ![wt_elevate_defaults](https://user-images.githubusercontent.com/3933920/151905675-91d04271-18bc-47ca-9a9e-448f064d4599.png) ### Expected Behavior - new un-elevated terminal window ### Actual Behavior - any profile is launched in same window and elevated, even the ones with `"elevate": false` set. Sample screenshot with CMD profile set to un-elevated: ![wt_cmd_not_elevated_profile](https://user-images.githubusercontent.com/3933920/151905280-98b109c6-9adb-4ea9-9311-ad3dc8187a30.png) `settings.json` with CMD not elevated: ``` "profiles": { "defaults": { "elevate": true, "startingDirectory": "C:\\" }, "list": [ { "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "hidden": false, "name": "Windows PowerShell" }, { "commandline": "%SystemRoot%\\System32\\cmd.exe", "elevate": false, "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "hidden": false, "name": "Command Prompt" }, ``` It works the other way around. If some profile is set to be elevated a new terminal window pops-up with admin rights.
claunia added the Needs-TriageIn-PRNeeds-Tag-FixIssue-Docs labels 2026-01-31 05:15:51 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 1, 2022):

That's on me, I still need to write the docs for elevate. Unfortunately, you can't go backwards. You can't de-elevate a package apparently, so elevate only works to spawn a new elevated window. Once you're in the elevated window, you can theoretically open anything.

I'm gonna make that very clear in the docs.

@zadjii-msft commented on GitHub (Feb 1, 2022): That's on me, I still need to write the docs for `elevate`. Unfortunately, you can't go backwards. [You can't de-elevate a package apparently](https://github.com/microsoft/terminal/blob/main/doc/specs/%235000%20-%20Process%20Model%202.0/%231032%20-%20Elevation%20Quality%20of%20Life%20Improvements.md#de-elevating-a-terminal), so elevate only works to spawn a new elevated window. Once you're in the elevated window, you can theoretically open anything. I'm gonna make that very clear in the docs.
Author
Owner

@zadjii-msft commented on GitHub (Feb 4, 2022):

Closed in https://github.com/MicrosoftDocs/terminal/pull/490

@zadjii-msft commented on GitHub (Feb 4, 2022): Closed in https://github.com/MicrosoftDocs/terminal/pull/490
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16565