GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): preserve native path separators in file path helpers by Hona · Pull Request #14912 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Feb 24, 2026

Copy link
Copy Markdown
Member

Summary

The Cygwin fix (a74fedd) normalized all paths to / in the frontend path helpers to fix change detection with mixed separators. This caused the web UI to show / instead of \ on Windows — a UI regression.

Fix: Canonicalize to / only for the prefix-stripping comparison, but slice from the original path to preserve native separators.

  • Cygwin paths (/c/Users/..., C:/Users/...) still match against native roots (C:\Users\...)
  • Windows users see \ in file paths (matching native behavior and the TUI)
  • Linux/Mac unchanged

Reverts the UI regression from #13659 while keeping the Cygwin compatibility.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings February 24, 2026 13:32
@Hona
Hona requested a review from adamdotdevin as a code owner February 24, 2026 13:32
Copilot started reviewing on behalf of Hona February 24, 2026 13:33
View session
@Hona
Hona force-pushed the fix/path-helpers-native-separators branch from 79ee9d3 to 8a4ef00 Compare February 24, 2026 13:35
@Hona
fix(app): preserve native path separators in file path helpers
e57fe7d
@Hona
Hona force-pushed the fix/path-helpers-native-separators branch from 8a4ef00 to e57fe7d Compare February 24, 2026 13:36
Copilot AI reviewed Feb 24, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a UI regression introduced in PR #13659 where Windows file paths were displayed with forward slashes (/) instead of native backslashes (\) in the web UI. The fix preserves native path separators while maintaining compatibility with Cygwin's mixed-separator paths.

Changes:

  • Modified path normalization to canonicalize paths only for comparison, then slice from the original path to preserve native separators
  • Updated path helper functions to handle both forward and backward slashes when stripping prefixes
  • Updated test expectations to verify that native separators are preserved in output paths

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/app/src/context/file/path.ts Modified normalize() to canonicalize paths only for prefix comparison while preserving original separators in the output
packages/app/src/context/file/path.test.ts Updated test expectations to verify Windows paths preserve backslashes while Unix paths preserve forward slashes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/app/src/context/file/path.test.ts
expect(path.normalize("C:/repo/src/app.ts")).toBe("src/app.ts")
expect(path.normalize("file://C:/repo/src/app.ts")).toBe("src/app.ts")
expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src/app.ts")
expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src\\app.ts")

Copilot AI Feb 24, 2026

Copy link

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions that Cygwin paths like "/c/Users/..." or "C:/Users/..." should match against native roots like "C:\Users...", but there are no test cases verifying this behavior. Consider adding test cases to ensure Cygwin path compatibility works as intended, for example testing paths starting with "/c/" or "/cygdrive/c/" against a Windows root.

Suggested change
expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src\\app.ts")
expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src\\app.ts")
// Cygwin-style paths should also normalize against the Windows root
expect(path.normalize("/c/repo/src/app.ts")).toBe("src/app.ts")
expect(path.normalize("/cygdrive/c/repo/src/app.ts")).toBe("src/app.ts")

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot uses AI. Check for mistakes.
Comment thread packages/app/src/context/file/path.ts
Comment on lines +111 to +112
// Only case-insensitive on Windows (drive letter or UNC paths)
const windows = /^[A-Za-z]:/.test(root) || root.startsWith("\\\\")

Copilot AI Feb 24, 2026

Copy link

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The canonicalization always lowercases both the root and path, even on non-Windows systems. This could cause issues on case-sensitive filesystems (Linux/Mac) where "/repo/Src/app.ts" and "/repo/src/app.ts" are different files. The original code only applied case-insensitive matching on Windows (when root started with a drive letter). Consider adding back the Windows detection to only lowercase on Windows systems.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot uses AI. Check for mistakes.
@Hona
Merge branch 'dev' into fix/path-helpers-native-separators
a852b11
adamdotdevin
adamdotdevin approved these changes Feb 24, 2026
View reviewed changes
@Hona
Hona merged commit 082f0cc into anomalyco:dev Feb 24, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jb-sk jb-sk mentioned this pull request Mar 16, 2026
Bug: file watcher paths stop matching open files on Windows #17780
Closed
@Astro-Han Astro-Han mentioned this pull request Apr 22, 2026
Improve Windows compatibility and restore Windows unit signal Astro-Han/pawwork#141
Closed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@Hona
fix(app): preserve native path separators in file path helpers (anoma…
7faa51c
…lyco#14912)
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@Hona
fix(app): preserve native path separators in file path helpers (anoma…
2a75748
…lyco#14912)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@Hona
fix(app): preserve native path separators in file path helpers (anoma…
7e8c39d
…lyco#14912)
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@Hona
fix(app): preserve native path separators in file path helpers (#14912)
bbdd636
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
@Hona
fix(app): preserve native path separators in file path helpers (anoma…
4779d1b
…lyco#14912)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@adamdotdevin adamdotdevin adamdotdevin approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Hona @adamdotdevin
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.