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

Open
opened 2026-02-16 18:16:57 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6626

State: open
Merged: No


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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6626 **State:** open **Merged:** No --- ## 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.
yindo added the pull-request label 2026-02-16 18:16:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12012