-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Support pwsh (PS Core) in Select Default Shell on Windows #72425
Comments
FYI @TylerLeonhardt |
Hi @Tyriar, Thank you for reviewing my PR. Can I try this issue again? My recognition of this issueI add the below between 'PowerShell Core' : [
`${process.env['ProgramW6432']}\\PowerShell\\6\\pwsh.exe`,
`${process.env['ProgramFiles']}\\PowerShell\\6\\pwsh.exe`,
], Currently, the version of PowerShell Core is 6.2. |
I think this issue is more complex than it looks like:
|
@roottool that's the basics of it and I'd merge something like that. @bergmeister anything on top of basic path detection would be great, if the path doesn't exist that's already handled, but pulling from the environment/registry are options to make this much more user friendly. FYI this command is only available on Windows as on Linux/Mac you normally configure your default shell via |
Traditionally, on Windows you used %COMSPEC% for the command processor. That works in Windows, DOS, and OS/2. For PowerShell and pwsh paths, I'd probably suggest looking at HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\PowerShell.exe and HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\pwsh.exe respectively. This would deal with the 6 vs. 7 issue that @roottool brought up. I don't have WSL installed to see if WSL respects those also, but I'd guess it does. GIT does not. I don't do enough js/ts to add these suggestions, but thought I'd add my 2 cents none-the-less. Thanks. |
The terminal used to default to COMSPEC, but ended up moving off it I think because everything assumes that's cmd.exe anyway so people don't change unlike $SHELL. |
The PowerShell Core MSI adds itself to the PATH environment variable, could we just simply call |
We can do that for all of those, except git bash (and I am aware that some people choose the option to have it added to their path - I for one, did not). I had presumed from @Tyriar 's earlier comment that he didn't want to do that. |
I tried while referring to @swngdnz's suggestion. I confirmed that I succeeded in getting the file path from the registry. I used I will create PR, but I have an one question. Thanks. |
@roottool yeah that would be great! We'll also need verify it works on a custom pwsh path. |
sorry for the trouble! but I think pwsh was the important one anyway. |
Code pointer: https://github.com/Microsoft/vscode/blob/e4b5bccf9364a0f678606d5bdfc18800854bf678/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts#L134-L145
The text was updated successfully, but these errors were encountered: