microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.78k stars 8.21k forks source link

Unable to launch Windows Terminal Preview from Windows + X #12204

Closed riku22 closed 2 years ago

riku22 commented 2 years ago

Windows Terminal version

1.12.3472.0

Windows build number

Windows11 22000.438

Other Software

I am using Windows Terminal Preview, but I cannot start Windows Terminal by pressing Windows+X and clicking "Windows Terminal". Is the Windows+X menu not compatible with Windows Terminal Preview?

Steps to reproduce

  1. Install Windows Terminal Preview from Microsoft Store.
  2. Press Windows+X.
  3. Click "Windows Terminal".

Expected Behavior

Windows Terminal Preview will be launched.

Actual Behavior

Windows Terminal Preview does not start.

zadjii-msft commented 2 years ago

I think you're seeing #10595, yea?

You need to make sure that the "App execution alias" for Windows Terminal Preview is turned on in the settings:

image

That's how the Win+X menu decides which version of the Terminal to launch. Does that fix it?

riku22 commented 2 years ago

I already have Windows Terminal Preview turned on. I've tried switching it on/off, but it doesn't seem to change.

237dmitry commented 2 years ago

Windows Terminal Preview doesn't start from this menu either.

zadjii-msft commented 2 years ago

Gosh, our work tracking system is a lot harder to follow in Windows 11. I can find the fix in builds like 22459, but I have no idea how that actually translates to 22000.xyz nomenclature. Are you on the Insiders channel (or any insiders build)? I know that fix is in Insiders, but I don't think it's been released to Windows 11 stable yet.

ParadoxV5 commented 2 years ago

[I hope I’m not necroposting] Was about to start a separate bug report, but then I saw this issue.

For me, my wt.exe executable in the app files appears to do nothing when run. The result is that both the entry in the Win+X menu (Start icon’s right-click menu) and the wt shell command (Start Menu search or PowerToys Run) doesn’t launch Windows Terminal Preview.

Context

I installed my Terminal Preview using the Microsoft Store. I located the file in question by choosing to run as Administrator (applicable for both Win+X and PowerToys Run) and expanding the UAC prompt, and found it at: "C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.12.3472.0_x64__8wekyb3d8bbwe\wt.exe"

ParadoxV5 commented 2 years ago

Side thoughts: Why have a separate wt.exe? Why not name the executable itself (WindowsTerminal.exe) as wt.exe?

zadjii-msft commented 2 years ago

Side thoughts: Why have a separate wt.exe? Why not name the executable itself (WindowsTerminal.exe) as wt.exe?

There's actually a long history to that issue. There are both bugs in the platform for having the centennial executable's name exactly the same as the execution alias, and different bugs when the exe's have different names. We're working with different names for now. It remains to be seen if this is truly the least buggy path 😕

DHowett commented 2 years ago

Also, there's a bug in some powershell versions where, if a package contains a GUI application, it will wait forever for that GUI application to exit. wt is a shim that launches WindowsTerminal and exits, which lets us avoid broken versions of PowerShell :smile:

DHowett commented 2 years ago

"C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.12.3472.0_x64__8wekyb3d8bbwe\wt.exe"

FWIW you shouldn't run wt OR windowsterminal directly out of the app package folder. That part of the platform is... very thorny.

If you Repair Terminal in the "All Apps & Features" page of settings, does wt start working again?

ParadoxV5 commented 2 years ago

FWIW you shouldn't run wt OR windowsterminal directly out of the app package folder. That part of the platform is... very thorny.

Of course, normally I don’t sneak into programs’ backdoors. That path was revealed by the UAC prompt.

If you Repair Terminal in the "All Apps & Features" page of settings, does wt start working again?

For me, I have already tried Repair, Reset and Unïnstall+Reïnstall…

floh96 commented 2 years ago

@DHowett i have the same problem windows 11 version 10.0.22000.438. "App execution alias" for Windows Terminal Preview is turned on in the settings. Repair does not help.

zadjii-msft commented 2 years ago

Sorry for the long turnaround on these. I'm gonna try reaching out to the App Execution Alias team to see if they have more guidance here. If the Terminal can be launched just fine from the Start Menu, but specifically wt.exe doesn't work[1], then there's something outside our control that's going wrong that we'll need some help figuring out.

Usually toggling the app execution alias in the Settings app should fix this. Worst case, repairing the app via the settings app should also help. But for some reason those don't seem to help everyone, so we need to figure out what's wrong when those don't work.

In the meantime, can you share the output of icacls "C:\Program Files\WindowsApps" (from an admin shell?) Filing feedback on "Developer Platform > Desktop Bridge" might also help get some traces to the folks that own this.

image

Correct WindowsApps permissions ``` \Program Files\WindowsApps NT SERVICE\TrustedInstaller:(F) NT SERVICE\TrustedInstaller:(OI)(CI)(IO)(F) S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(RX) S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(OI)(CI)(IO)(GR,GE) NT AUTHORITY\SYSTEM:(F) NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F) BUILTIN\Administrators:(CI)(RX) NT AUTHORITY\LOCAL SERVICE:(OI)(CI)(RX) NT AUTHORITY\NETWORK SERVICE:(OI)(CI)(RX) NT AUTHORITY\RESTRICTED:(OI)(CI)(RX) BUILTIN\Users:(Rc,S,RD,REA,X,RA) ```

As a matter of cross-linking:

[1]: The Win+X menu is also powered by wt.exe on builds above 22000.490. Before that, it only used Windows Terminal stable. If you only have Windows Terminal Preview installed, that won't work right below that build.

floh96 commented 2 years ago

@zadjii-msft Windows app permissions

C:\Windows\system32>icacls "C:\Program Files\WindowsApps"
C:\Program Files\WindowsApps NT SERVICE\TrustedInstaller:(F)
                             NT SERVICE\TrustedInstaller:(OI)(CI)(IO)(F)
                             S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(RX)
                             S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(OI)(CI)(IO)(GR,GE)
                             NT-AUTORITÄT\SYSTEM:(F)
                             NT-AUTORITÄT\SYSTEM:(OI)(CI)(IO)(F)
                             VORDEFINIERT\Administratoren:(CI)(RX)
                             NT-AUTORITÄT\Lokaler Dienst:(OI)(CI)(RX)
                             NT-AUTORITÄT\Netzwerkdienst:(OI)(CI)(RX)
                             NT-AUTORITÄT\EINGESCHRÄNKTER ZUGRIFF:(OI)(CI)(RX)
                             VORDEFINIERT\Benutzer:(Rc,S,RD,REA,X,RA)

1 Dateien erfolgreich verarbeitet, bei 0 Dateien ist ein Verarbeitungsfehler aufgetreten.
zadjii-msft commented 2 years ago

Another debugging question from the AEA team: Do any other App Execution Aliases work from the run dialog or a console window? You can find all of them in the settings app. spotify.exe, snippingtool.exe, winget.exe are all good examples.

floh96 commented 2 years ago

@zadjii-msft for me the other aliases are all working. btw wt.exe is also working for me from the run dialog but it is not working from the windows x menu.

zadjii-msft commented 2 years ago

You know, that's a good point. I'm not sure which version of the OS actually was changed to use the alias. Nor do I actually know how they were launching the Terminal prior to making that change. I suspect this will get better with an Insiders update, but like I said, I dunno which version has the change...

eryksun commented 2 years ago

icacls "C:\Program Files\WindowsApps"

Better: cacls "%ProgramFiles%\WindowsApps" /s

The SDDL output from cacls.exe (not icacls.exe) avoids localized names and correctly shows conditional entries such as "(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))".

zadjii-msft commented 2 years ago

Oh derp.

Okay so MSFT:37092552 seems to imply this will be fixed in 22000.490, which isn't out yet.

If you're hitting this, then can you confirm which version of the Terminal you have installed? If you only have Windows Terminal Preview installed, then Win+X won't work for you.

ParadoxV5 commented 2 years ago

If you only have Windows Terminal Preview installed, then Win+X won't work for you.

Only Terminal Preview is installed. Wouldn’t be surprised if Terminal release’s wt is fine.

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

ParadoxV5 commented 2 years ago

Excuse me for the necroposting, I just wanted to update this topic on the status:

:grapes:. This issue is now technically resolved as unreproducible because [P.S. in the latest Windows Insider Beta (and Dev too, for now) channel build] the Win+X menu is showing PowerShell instead of WT.

Feedback Hub feedback:

feedback-hub:?contextid=49&feedbackid=62504f60-361b-44b0-9643-efce5c344c3e&form=1&src=1
DHowett commented 2 years ago

Funny enough, it will only switch back to "PowerShell" if it thinks Terminal is inaccessible . . . so technically that's working as intended (though admittedly it does insulate users from the root cause...)

ParadoxV5 commented 2 years ago

it will only switch back to "PowerShell" if it thinks Terminal is inaccessible

If so, the Windows Win+X menu is WAI because the <q>root cause</q> is <q>Terminal is inaccessible</q>, which is WT’s problem…

NUSHA241 commented 6 months ago

Windows Terminal version

1.12.3472.0

Windows build number

Windows11 22000.438

Other Software

I am using Windows Terminal Preview, but I cannot start Windows Terminal by pressing Windows+X and clicking "Windows Terminal". Is the Windows+X menu not compatible with Windows Terminal Preview?

Steps to reproduce

  1. Install Windows Terminal Preview from Microsoft Store.
  2. Press Windows+X.
  3. Click "Windows Terminal".

Expected Behavior

Windows Terminal Preview will be launched.

Actual Behavior

Windows Terminal Preview does not start.