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

[Windows] Use pwsh (Powershell 7) if detected #22015

Open
1 task done
JakeIsMeh opened this issue Dec 14, 2024 · 3 comments
Open
1 task done

[Windows] Use pwsh (Powershell 7) if detected #22015

JakeIsMeh opened this issue Dec 14, 2024 · 3 comments
Labels
enhancement [core label] terminal Feedback for terminal integration, shell commands, etc windows

Comments

@JakeIsMeh
Copy link

Check for existing issues

  • Completed

Describe the feature

Currently, Zed uses powershell as the default shell on Windows. It would be nice if Zed defaulted to using pwsh if detected on the user's system.

Background

On Windows, Windows PowerShell (aka powershell.exe (versions 1-5.1) is bundled as the system shell.
In 2019, Microsoft released pwsh 7 as an OSS and cross-platform re-implementation and modern replacement for powershell 5.1.
pwsh, however, is NOT bundled with Windows and is actually what the update nag message that shows up everytime you launch powershell is referring to.

Environment

Version: Zed 0.165.4 @ c8199d4
Source: MSYS2 (UCRT64)
OS: Windows 11, 23H2

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@notpeter notpeter added terminal Feedback for terminal integration, shell commands, etc windows and removed triage labels Dec 16, 2024
@notpeter
Copy link
Member

The new PowerShell is vastly superior, and Zed should consider preferring it when available, especially given that there is no equivalent to chsh for defining a user's preferred Shell like there is on macOS/Linux/etc.

See also:

@shenjackyuanjie
Copy link
Contributor

I think I may have a try on that

@SturdyFool10
Copy link

I was using the option in the config to set the terminal program, but this would be much smoother as finding the specific apps in the microsoft store is a pain, and looks like:

"terminal": {
    "shell": {
        "program": "C:\\Users\\<username>\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.PowerShell_8wekyb3d8bbwe\\pwsh.exe"
    }
},

which would be a great thing to just "detect" since the default is pwsh 1.0 and we are on 7.5.something at this stage, also, I should note that as of updating from nightly a month ago(ish) and last night, adding this to the settings.json causes a fun panic on launch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] terminal Feedback for terminal integration, shell commands, etc windows
Projects
None yet
Development

No branches or pull requests

4 participants