Skip to content

fix: support Windows UNC paths in explorer and produced-file resolution - #79

Open
LuckinOvaltine wants to merge 1 commit into
omdsh-dev:mainfrom
LuckinOvaltine:fix/accept-unc-paths
Open

fix: support Windows UNC paths in explorer and produced-file resolution#79
LuckinOvaltine wants to merge 1 commit into
omdsh-dev:mainfrom
LuckinOvaltine:fix/accept-unc-paths

Conversation

@LuckinOvaltine

Copy link
Copy Markdown

Problem

On Windows, when a session's working directory is a UNC network path
(e.g. \\server\share\project), the sidebar explorer fails to list the
directory with "... is not an absolute path", and the produced-file
"open in sidebar" feature mis-resolves UNC paths.

requireAbsolute() only accepted /-prefixed and drive-letter (C:\)
paths; resolveSidebarPath() had the same gap in the client half.

Changes

  • src/fs-tree.ts: use Node's path.isAbsolute() (which returns true
    for UNC paths on win32) in requireAbsolute().
  • src/client/produced-files.ts: treat \\-prefixed paths as absolute
    in resolveSidebarPath().
  • tests/unit.spec.ts: add win32 cases covering UNC paths for both
    helpers.

How I verified

  • pnpm typecheck passes.
  • pnpm build passes (tsc + tsdown).
  • New UNC test cases pass. The remaining pnpm test failures on a local
    Windows machine are pre-existing platform issues (CRLF line endings,
    /bin/bash vs powershell.exe, drive-letter resolution) and are
    unchanged by this PR.

Risks / Notes

  • No behavior change for POSIX or drive-letter absolute paths.
  • UNC detection is guarded to the win32 platform in tests.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

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.

1 participant