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

windows terminal (as well as windows terminal preview) only runs in admin mode #14788

Closed
haosmos opened this issue Feb 4, 2023 · 14 comments
Closed
Assignees
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@haosmos
Copy link

haosmos commented Feb 4, 2023

Windows Terminal version

1.17.1023 (preview) & 1.16.10261.0

Windows build number

10.0.22000.1455

Other Software

No response

Steps to reproduce

windows terminal (as well as windows terminal preview) only runs in admin mode

windows terminal (as well as windows terminal preview) does not start in normal mode - when you click on the icon in the taskbar or when you run it from the power run field (a utility from the powertoys package) or when you use the wt.exe command on the command line or when you run it from WIN + R (wt.exe) - nothing happening.

it is possible to launch windows terminal (as well as windows terminal preview) only if you run it in administrator mode - either select this option in the taskbar, or from the power run field.

Expected Behavior

windows terminal (as well as windows terminal preview) run like regular windows programs without having to run them in administrator mode

Actual Behavior

when you click on the icon in the taskbar or when you run it from the power run field (a utility from the powertoys package) or when you use the wt.exe command on the command line or when you run it from WIN + R (wt.exe) - nothing happening.

it is possible to launch windows terminal only if you run it in administrator mode - either select this option in the taskbar, or from the power run field

@haosmos haosmos added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 4, 2023
@Wuhao1627003
Copy link

Wuhao1627003 commented Feb 5, 2023

Same thing happened to me with latest versions of WT and WT Preview. Never happened in earlier versions. Considering WT was updated 2 weeks ago, and worked fine last week, I suspect a compatibility problem with latest version of Win11 insiders build 25290.1000, which was released 3 days ago, roughly when the problem started for me.

@haosmos
Copy link
Author

haosmos commented Feb 5, 2023

UPD: after disabling the option "run this profile as an administrator" in the wt settings (as well as wt preview), it turns out to run like normal programs.

but if you turn on the "run this profile as an administrator" option again, then wt (as well as wt preview) does not start again

@Wuhao1627003
Copy link

For me running as admin also won't work. A window shows, but is stuck there for several secs, then crashes.

@zadjii-msft
Copy link
Member

zadjii-msft commented Feb 5, 2023

1.17.1023 (preview) & 1.16.10261.0

UPD: after disabling the option "run this profile as an administrator" in the wt settings (as well as wt preview), it turns out to run like normal programs.

but if you turn on the "run this profile as an administrator" option again, then wt (as well as wt preview) does not start again

Ruh roh, looks like #14637 must have actually broken some scenarios, despite fixing some other ones. That's no good. See also #14729, https://github.com/microsoft/terminal/releases/tag/v1.16.10261.0

I honestly don't know how to go about debugging this one. The last time we hit this, it was a loader issue, that was solved by calling into shell:AppsFolder instead....

Actually, that's somewhere to start I suppose. If you go to File Explorer, type shell:AppsFolder into the address bar and hit go, you'll open a list of applications. Is the Terminal in there/?

Note for discussion: just bringing this to the team's attention.

@zadjii-msft zadjii-msft added the Needs-Discussion Something that requires a team discussion before we can proceed label Feb 5, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 5, 2023
@haosmos
Copy link
Author

haosmos commented Feb 6, 2023

1.17.1023 (preview) & 1.16.10261.0

UPD: after disabling the option "run this profile as an administrator" in the wt settings (as well as wt preview), it turns out to run like normal programs.
but if you turn on the "run this profile as an administrator" option again, then wt (as well as wt preview) does not start again

Ruh roh, looks like #14637 must have actually broken some scenarios, despite fixing some other ones. That's no good. See also #14729, v1.16.10261.0 (release)

I honestly don't know how to go about debugging this one. The last time we hit this, it was a loader issue, that was solved by calling into shell:AppsFolder instead....

Actually, that's somewhere to start I suppose. If you go to File Explorer, type shell:AppsFolder into the address bar and hit go, you'll open a list of applications. Is the Terminal in there/?

Note for discussion: just bringing this to the team's attention.

yes, windows terminal (preview version also) are present here

explorer_KiXc2W3Eyo

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 6, 2023
@zadjii-msft
Copy link
Member

Team discussion thoughts: We need to keep these issues separate.

  • problem A: I've set elevate:true in one of my profiles, and now I can only launch my Terminal elevated. Trying to launch it unelevated doesn't work.
  • problem B: I tried to right-click "Run as admin" the Terminal, and it didn't launch.

The first goes through elevate-shim, the second doesn't.

(more here notes as we noodle...)

@jboelter
Copy link
Contributor

jboelter commented Feb 7, 2023

UPD: after disabling the option "run this profile as an administrator" in the wt settings (as well as wt preview), it turns out to run like normal programs.

but if you turn on the "run this profile as an administrator" option again, then wt (as well as wt preview) does not start again

This sounds like #13928

If you're running under the Administrator account (and maybe other account types?), using the "elevate": true or "Run this profile as Administrator" option in the settings.json or GUI will result in an infinite loop.

When you remove the elevate: true option and run cmd.exe, what does running net session say? This is an obscure way to see if you're running with admin privileges or not.

If you see this; then you are not running with administrative privileges (seems to disprove my hypothesis)

C:\Users\jboelter>net session
System error 5 has occurred.

Access is denied.

However, if you see this, then you are running with administrative privileges; despite not setting elevate: true or running as admin.

C:\Users\jboelter>net session
There are no entries in the list.

Note; you can also the change the setting to elevate: false in settings.json in the defaults and the specific profiles while it's in this crash loop and the window will suddenly appear.

@haosmos
Copy link
Author

haosmos commented Feb 7, 2023

now I have "elevate": false for the default profile and the C:\Users\chaosmosr>net session command displays the following message in the console (I ran wt as administrator in the powershel profile in the settings the flag is set to run from profile as administrator:

WindowsTerminal_4xs4LN1S09

Code_O8NLSlwt2z

if i change when i change the value to "elevate": true in default profile or in powershell profile itself then wt doesn't start normally again, only run as administrator.

the net session command displays the same message: "There are no items in the list".

if I turn off the "run as profile as administrator" option for the default profile and leave the "run as profile as administrator" option for the powershell profile itself in the wt settings via the GUI, then nothing will change, wt will not start again.

but if I specify "elevate": false in the settings.json file for the default profile and for the powershell profile itself then wt runs like a normal program (without having to run wt as administrator), the the net session command prints this message to the console:

Code_L3htWE3UPx

@zadjii-msft
Copy link
Member

Wait could you clarify/?

In the first screenshot it looks like (defaults.elevate: false, powershell.elevate:true), and it looks like it's working just fine. But then right after that you mention:

if I turn off the "run as profile as administrator" option for the default profile and leave the "run as profile as administrator" option for the powershell profile itself in the wt settings via the GUI, then nothing will change, wt will not start again.

Which sounds like the opposite is true.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Feb 13, 2023
@haosmos
Copy link
Author

haosmos commented Feb 15, 2023

Wait could you clarify/?

In the first screenshot it looks like (defaults.elevate: false, powershell.elevate:true), and it looks like it's working just fine. But then right after that you mention:

if I turn off the "run as profile as administrator" option for the default profile and leave the "run as profile as administrator" option for the powershell profile itself in the wt settings via the GUI, then nothing will change, wt will not start again.

Which sounds like the opposite is true.

perhaps in the previous comments indicated something wrong. Now checked again.

the windows terminal starts as a normal program (without the need to run as administrator) if you turn off the "run as administrator" option in the GUI settings: the settings.json file at this point looks like this:

WindowsTerminal_7T2iJ6UZmG

WindowsTerminal_n5kYq2Azqa

if I specify: "elevate": true" in settings.json in the default profile, and in PowerShell settings I specify "elevate": false", then I can run wt as a normal program.

But if I specify "elevate": true" in the PowerShell settings, then again I can't run wt as a normal program.

I'd like my default profile - PowerShell to run as administrator when starting wt, but so that I don't have to run wt, always as administrator.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 15, 2023
@haosmos
Copy link
Author

haosmos commented Feb 15, 2023

one more observation: when i specify "elevate": true" in settings.json in the default profile, then i can run wt as a normal program, but then wsl doesn't start. If i run wt as administrator, then wsl starts. if I specify "elevate": true" in settings.json in the default profile, then wsl is started.

@zadjii-msft
Copy link
Member

Ah okay, thanks for the clarification. This does look like it's /dup #13928 then after all ☺️

@microsoft-github-policy-service
Copy link
Contributor

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service microsoft-github-policy-service bot removed this from the Terminal v1.18 milestone Feb 15, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Feb 15, 2023
@carlos-zamora carlos-zamora removed the Needs-Discussion Something that requires a team discussion before we can proceed label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

6 participants
@jboelter @carlos-zamora @zadjii-msft @Wuhao1627003 @haosmos and others