Skip to content

fix: use case-insensitive path comparison on Windows to prevent duplicate projects#6626

Open
usvimal wants to merge 2 commits intoanomalyco:devfrom
usvimal:fix/windows-path-deduplication
Open

fix: use case-insensitive path comparison on Windows to prevent duplicate projects#6626
usvimal wants to merge 2 commits intoanomalyco:devfrom
usvimal:fix/windows-path-deduplication

Conversation

@usvimal
Copy link
Contributor

@usvimal usvimal commented Jan 2, 2026

Summary

On Windows, file paths are case-insensitive but the project deduplication check used strict equality (===). This caused the same directory opened with different casing (e.g., C:\Users vs c:\Users) to appear as separate entries in the sidebar.

Changes

  • Added isWindows() helper to detect Windows platform
  • Added pathsEqual() helper for case-insensitive path comparison on Windows
  • Updated all path comparisons in projects.open/close/expand/collapse/move to use pathsEqual()

Testing

Tested on Windows 11 - opening the same directory with different path casing no longer creates duplicate sidebar entries.

On Windows, the directory selector was limited to browsing within the
user's home directory (C:\Users\<username>). This made it impossible
to open projects on other drives like D:\ or outside the user profile.

Changes:
- Add isAbsolutePath() to detect Windows drive letters and Unix paths
- Add getSearchRoot() to extract search directory from absolute paths
- Modify fetchDirs() to search from absolute paths when detected
- Update placeholder text to hint absolute path support

Fixes anomalyco#6490
…cate projects

On Windows, file paths are case-insensitive but the project deduplication
check used strict equality (===). This caused the same directory opened with
different casing (e.g., C:\Users vs c:\Users) to appear as separate entries
in the sidebar.

Added isWindows() and pathsEqual() helper functions that perform
case-insensitive comparison on Windows while maintaining case-sensitive
comparison on other platforms.
@adamdotdevin
Copy link
Contributor

@Hona can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments