-
Notifications
You must be signed in to change notification settings - Fork 30
fix: use '/' delimiter on windows when using gitbash. #178
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
Conversation
fea3cc9 to
d3b30b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR fixes shell detection issues on Windows by ensuring GitBash paths use forward slashes and refactors fallback order for shell detection. Key changes include:
- Adding unit tests for various shell types.
- Updating the GitBash regex in shellDetector to cover additional patterns.
- Replacing unsafeEntries usage with a new _entries function in shellDetector.
- Refactoring Venv and Conda utility modules to include a pathForGitBash helper that replaces backslashes.
- Removing the now redundant unsafeEntries utility file.
Changes
| File | Description |
|---|---|
| src/test/features/common/shellDetector.unit.test.ts | Added tests for multiple shell types with a check to skip “unknown” shells |
| src/features/common/shellDetector.ts | Updated GitBash regex, replaced unsafeEntries with _entries, and reordered shell detection fallbacks |
| src/managers/builtin/venvUtils.ts | Refactored Venv command mappings using a new pathForGitBash helper and modernized the code style |
| src/managers/conda/condaUtils.ts | Added GitBash-specific shell activation/deactivation using pathForGitBash and updated environment creation logic |
| src/common/utils/unsafeEntries.ts | Removed the unsafeEntries file now replaced by a custom _entries function in shellDetector |
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/test/features/common/shellDetector.unit.test.ts:133
- Ensure that comparing the test string 'unknown' to TerminalShellType.unknown is type-safe; verify that both values are compatible (e.g., if TerminalShellType.unknown is a string literal) to avoid unexpected mismatches.
if (shellType === TerminalShellType.unknown) {
src/features/common/shellDetector.ts:171
- Review the reordering of fallback detection functions; using identifyShellFromVSC before identifyShellFromTerminalName may change the intended detection logic—ensure this new order still meets all edge cases.
shellType = identifyShellFromVSC(terminal);
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
|
If the changes appear safe, you can manually trigger the pipeline by commenting |
fixes #173