Skip to content

fix(app): normalize Windows paths for consistent project matching#11668

Open
Rettend wants to merge 1 commit intoanomalyco:devfrom
Rettend:fix/windows-path-normalize
Open

fix(app): normalize Windows paths for consistent project matching#11668
Rettend wants to merge 1 commit intoanomalyco:devfrom
Rettend:fix/windows-path-normalize

Conversation

@Rettend
Copy link
Contributor

@Rettend Rettend commented Feb 1, 2026

What does this PR do?

fixes #11666, see issue description.

How did you verify your code works?

  1. open a project with ctrl+o
  2. open the same project with the opencode deep link
    -> only one project is open

Admittedly the scope of these changes is larger, and I am not sure this is the best way to fix the issue.

On Windows, paths can use either forward slashes (C:/Users/...) or
backslashes (C:\Users\...). Deep links from external apps like GitButler
use forward slashes, while paths from the file system may use backslashes.
This caused duplicate project entries and broken ~ display.

- Add normalizePath() to convert backslashes to forward slashes
- Normalize paths in project open/close/expand/collapse/move/touch
- Fix ~ home directory display by normalizing before comparison
- Normalize paths at entry points (openProject, navigateToProject)
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found several related PRs that address similar Windows path handling and project matching issues:

Potentially Related PRs:

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

    • Directly addresses preventing duplicate projects on Windows, which aligns with the issue being fixed
  2. PR fix(lsp): normalize Windows drive letter case for consistent URIs #10049 - "fix(lsp): normalize Windows drive letter case for consistent URIs"

    • Similar path normalization approach for Windows
  3. PR fix(windows): path handling fixes for Windows #6763 - "fix(windows): path handling fixes for Windows"

    • General Windows path handling fixes
  4. PR fix(app): allow browsing absolute paths on Windows #6624 - "fix(app): allow browsing absolute paths on Windows"

    • Related to Windows path handling

Why they're related:
These PRs address the same core issue - Windows path handling inconsistencies that can lead to duplicate project detection. PR #6626 specifically focuses on preventing duplicate projects through case-insensitive comparison, which is directly related to the current PR's goal of normalizing paths for consistent project matching when using deep links vs. manual project opening.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] Opening with deep link duplicates projects

1 participant

Comments