Skip to content

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

Closed
iso2kx wants to merge 2 commits intoanomalyco:devfrom
iso2kx:fix/windows-path-deduplication
Closed

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

Conversation

@iso2kx
Copy link
Copy Markdown
Contributor

@iso2kx iso2kx 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.

usvimal added 2 commits January 2, 2026 13:16
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 #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
Copy Markdown
Member

@Hona can you take a look?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions bot closed this Mar 4, 2026
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