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

Pressing CTRL+SHIFT, ENTER in Windows Run Dialog should run as admin #6625

Closed
aplocher opened this issue Jun 22, 2020 · 4 comments · Fixed by #6860
Closed

Pressing CTRL+SHIFT, ENTER in Windows Run Dialog should run as admin #6625

aplocher opened this issue Jun 22, 2020 · 4 comments · Fixed by #6860
Labels
Area-Commandline wt.exe's commandline arguments Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@aplocher
Copy link

Description of the new feature/enhancement

Would like to be able to open the Windows "Run" dialog (WINKEY+R) and type "wt", then press CTRL+SHIFT+ENTER to open as an Administrator, like I do with "cmd.exe" (or any other app).

I'm not sure if this should be filed as a feature or a bug...

Proposed technical implementation details (optional)

Thanks!

@aplocher aplocher added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jun 22, 2020
@ghost ghost added 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 labels Jun 22, 2020
@KalleOlaviNiemitalo
Copy link

These work, though:

  • Press only the Windows key (not Windows+R), type "wt", and press Ctrl+Shift+Enter.
  • Open %USERPROFILE%\AppData\Local\Microsoft\WindowsApps in File Explorer, right-click wt.exe, and choose Run as Administrator.

I don't understand why it does not work for wt in the "Run" dialog, even though it works for e.g. skype, which likewise has a Microsoft Store signature. Is that caused by something in the AppX manifest?

@DHowett
Copy link
Member

DHowett commented Jun 22, 2020

So, we heard back from the AppX team about this. It's a bug in the platform 😄 which I am certain is everyone's favorite thing to hear!

@DHowett
Copy link
Member

DHowett commented Jun 22, 2020

It turns out that when an application's alias name doesn't match its filename (as in our case, wt.exe is an alias for WindowsTerminal.exe ), it fails out during elevated launch.

We can fix this by renaming our executable or providing a local shim.

I'm interested in the shim option, as it might solve another issue we've been hitting ...

@zadjii-msft zadjii-msft added Area-Commandline wt.exe's commandline arguments Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jun 23, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 23, 2020
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Jun 23, 2020
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 23, 2020
DHowett added a commit that referenced this issue Jul 10, 2020
Due to a shell limitation, Ctrl+Shift+Enter will not launch Windows
Terminal as Administrator. This is caused by the app execution alias and
the actual targeted executable not having the same name.

In addition, PowerShell has an issue detecting app execution aliases as
GUI/TUI applications. When you run wt from PowerShell, the shell will
wait for WT to exit before returning to the prompt. Having a shim that
immediately re-executes WindowsTerminal and then returns handily knocks
this issue out (as the process that PS was waiting for exits
immediately.)

This could cause a regression for anybody who tries to capture the PID
of wt.exe. Our process tree is not an API, and we have offered no
consistency guarantee on it.

Fixes #4645 (PowerShell waits for wt)
Fixes #6625 (Can't launch as admin using C-S-enter)
@ghost ghost added the In-PR This issue has a related PR label Jul 10, 2020
@ghost ghost closed this as completed in #6860 Jul 10, 2020
ghost pushed a commit that referenced this issue Jul 10, 2020
Due to a shell limitation, Ctrl+Shift+Enter will not launch Windows
Terminal as Administrator. This is caused by the app execution alias and
the actual targeted executable not having the same name.

In addition, PowerShell has an issue detecting app execution aliases as
GUI/TUI applications. When you run wt from PowerShell, the shell will
wait for WT to exit before returning to the prompt. Having a shim that
immediately re-executes WindowsTerminal and then returns handily knocks
this issue out (as the process that PS was waiting for exits
immediately.)

This could cause a regression for anybody who tries to capture the PID
of wt.exe. Our process tree is not an API, and we have offered no
consistency guarantee on it.

VALIDATION
----------

Tested manual launch in a number of different scenarios:

* [x] start menu "wtd"
* [x] start menu tile
* [x] powertoys run
* [x] powertoys run ctrl+shift (admin)
* [x] powershell inbox, "core"
* [x] cmd
* [x] run dialog
* [x] run dialog ctrl+shift (admin)
* [x] run from a lnk with window mode=maximized

Fixes #4645 (PowerShell waits for wt)
Fixes #6625 (Can't launch as admin using C-S-enter)
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Jul 10, 2020
@ghost
Copy link

ghost commented Jul 22, 2020

🎉This issue was addressed in #6860, which has now been successfully released as Windows Terminal Preview v1.2.2022.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Commandline wt.exe's commandline arguments Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants