Open kurame-yotsuba opened 3 years ago
Thanks for reporting this! I didn't know about the %scoop%
env var and the ability to install scoop to a custom directory. Probably wouldn't be too hard to fix this...
/cc @DHowett
Is it guaranteed that SCOOP
and SCOOP_GLOBAL
are set?
Every location we search needs a differentiator; otherwise, we may detect three instances of PowerShell and they'll collapse into one. Right now, we only have one Scoop differentiator.
I think those variables are not set by default (I don't find them in my system).
From the documentation here, it looks like you can change the directory for user-installed programs and global-installed programs independently.
In my case too, those variables were not set by default before changing into custom directory.
Using Scoop, we can install following 4 locations,
To decide which PowerShell is used from these, I think the priorities of search is needed.
I think checking %PATH% first would largely solve the problem. pwsh.exe
is in PATH by default when installing either way (scoop or official .msi).
Environment
Windows build number: 10.0.19042.0 Windows Terminal version (if applicable): 1.4.3141.0
PowerShell Core: 7.1.0 Scoop
Steps to reproduce
Expected behavior
When environment variable
SCOOP
orSCOOP_GLOBAL
is defined, Terminal should search pwsh.exe in%SCOOP%
and%SCOOP_GLOBAL%
in addition to%USERPROFILE%\scoop
.Actual behavior
Error dialog is opened. The content of error message is "An error occurred while loading the settings." (Sorry, I don't know the message of English version because I use Japanese version).
And, PowerShell is used instead, and PowerShell Core doesn't appear in the shell list.
Searching place is only
%USERPROFILE%scoop
for Scoop. (ref: PowershellCoreProfileGenerator.cpp Line 281, Tag 1.4.3141.0)Related issue
1415