fix(windows): normalize paths for case-insensitive comparison on Windows#75
Merged
Merged
Conversation
Windows paths are case-insensitive, but string comparison was case-sensitive. This caused signal routing to fail when workspace folder paths had different case (e.g., 'F:\Github' vs 'f:\Github'). Normalize paths to lowercase on Windows before comparison in: - cwdMatchesFolder() in src/routing/cwd.ts - Test-CwdInsideFolder in hook/_lib.ps1 - cwdInsideFolder() in hook/_lib/active.js This ensures parity across all three path-matching functions.
Owner
|
Merged, thanks for splitting this out. Nice work covering all three path-matching functions (TS, PS1, and JS), that parity is exactly what I was hoping for, and the PowerShell Two follow-ups whenever you get to them:
Appreciate the contributions. |
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.
Windows paths are case-insensitive, but string comparison was case-sensitive. This caused signal routing to fail when workspace folder paths had different case (e.g., 'F:\Github' vs 'f:\Github').
Normalize paths to lowercase on Windows before comparison in:
This ensures parity across all three path-matching functions.
Summary
when workspace folder paths had different casing (e.g., 'F:\Github' vs 'f:\Github')
cwdMatchesFolder() (TS), Test-CwdInsideFolder (PS1), and cwdInsideFolder() (JS)
Test plan
npm testgreen locallynpm run typecheck && npm run lint && npm run format:checkgreennpm run smokegreen (macOS).vsixinto a fresh VS Code profile and confirmed expected behavior/test-notifierskill end-to-end.vsixand verified notifications on WindowsNotes for reviewer
PowerShell version uses
[IO.Path]::DirectorySeparatorChar -eq '\'to detectWindows for cross-version compatibility (works in both Windows PowerShell 5.x
and PowerShell Core 6+).