fix(utils): detect Windows shell type for correct installer selection#247
Open
fix(utils): detect Windows shell type for correct installer selection#247
Conversation
Add detectWindowsShell() to distinguish PowerShell, Git Bash/MSYS2, and CMD at runtime. Use windowsPs installer URL when PowerShell is detected, falling back to the CMD-compatible installer otherwise. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the Windows native installer by detecting which shell is active at runtime (PowerShell, Git Bash/MSYS2, or CMD) and selecting the appropriate installer command accordingly.
Changes
windowsPs?: stringfield toInstallerUrlstype for a PowerShell-specific installer URLdetectWindowsShell()utility to distinguish between PowerShell (PS5/PS7), Git Bash/MSYS2, and CMD based on environment variableshttps://claude.ai/install.ps1)native-installer.tsuses the PowerShell installer when PowerShell is detected, with CMD fallback otherwiseImpact
Before: Windows always used the CMD-compatible installer regardless of the active shell, which could fail or behave poorly in PowerShell environments.
After: PowerShell users get the PowerShell-native installer; CMD and Git Bash users get the appropriate fallback.
Checklist