opencode
opencode copied to clipboard
fix: use case-insensitive path comparison on Windows to prevent duplicate projects
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/moveto usepathsEqual()
Testing
Tested on Windows 11 - opening the same directory with different path casing no longer creates duplicate sidebar entries.