Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Why it's related: This PR has the exact same title and addresses the same issue (Windows Store/MSIX shell installations not being resolved). It appears to be a previous attempt at the same fix. You should verify whether #43323 is still open, closed, or merged, and consider whether this PR (48968) supersedes it or if there's redundant work being done. |
|
The |
|
Confirming the flag: #43323 is mine and is the same fix targeting |
Issue for this PR
Closes #41426
Type of change
What does this PR do?
A shell installed from the Microsoft Store — most commonly
pwsh— is not found, so settingshell: "pwsh"silently falls back to Windows PowerShell 5.1.Store/MSIX installs expose their executable as an app-execution alias: a zero-byte
AppExecLinkreparse point onPATH.CreateProcessresolves it by name, butstatreports nothing andwhichskips it.executable()inshell/select.tsresolves non-rooted names throughwhich, so the shell comes back as "not installed" and selection moves on without telling the user.Measured on a Windows 11 box, using
winget(always an alias) as the probe:fs.existsSync(alias)falsefs.statSync(alias)undefinedspawnSync("winget")0where.exedoes see aliases, so it distinguishes "installed as an alias" from "not installed". The fallback is scoped narrowly: win32 only, only for a name already inMETA, and only afterwhichhas failed — so it cannot make an unrelated or absent binary resolve.This also looks like the root cause behind #30615 and #17372.
How did you verify your code works?
packages/core/test/shell.test.ts— 11/11 pass. Added a case asserting that a known-but-absent shell (zsh,ksh) still falls back rather than resolving to its own bare name, which is the regression this fallback could otherwise introduce. Verifiedwhere.exereturns 0 for an installed alias and 1 for an absent shell on the same machine.Checklist