Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
elsaco opened this issue Feb 1, 2022 · 2 comments · Fixed by MicrosoftDocs/terminal#490
Labels
In-PR This issue has a related PR Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@elsaco
Copy link

elsaco commented 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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 1, 2022
@zadjii-msft
Copy link
Member

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 zadjii-msft added the Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs label Feb 1, 2022
@zadjii-msft zadjii-msft added the In-PR This issue has a related PR label Feb 1, 2022
@zadjii-msft
Copy link
Member

Closed in MicrosoftDocs/terminal#490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In-PR This issue has a related PR Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants