Skip to content

fix: translate MSYS drive-mount root on Windows nodes (1.27.3)#72

Merged
gmpassos merged 1 commit into
masterfrom
fix/drive-mount-windows-msys-path
Jun 21, 2026
Merged

fix: translate MSYS drive-mount root on Windows nodes (1.27.3)#72
gmpassos merged 1 commit into
masterfrom
fix/drive-mount-windows-msys-path

Conversation

@gmpassos

Copy link
Copy Markdown
Contributor

Problem

omnyshell drive mount /my-local/dir-x windows-2gpu:/c/Users/foo/dir-x created the node mirror at /c/c/Users/foo/dir-x (i.e. C:\c\Users\foo\dir-x) instead of C:\Users\foo\dir-x.

The client sends the remote root in MSYS/Git-Bash form (/c/... = the C: drive). NodeDriveService.run() resolved it with only expandUserHome(...), which leaves /c/... untouched. On Windows, dart:io treats a /-rooted path as relative to the current drive, so Directory('/c/Users/foo/dir-x').create() produced C:\c\Users\foo\dir-x.

Fix

NodeDriveService now applies the existing windowsPathFromMsys helper to the mount root, guarded by Platform.isWindows && _root.startsWith('/') — the same pattern the shell-exec backends (process_shell_backend.dart, winpty_shell_backend.dart) already use for working directories. POSIX nodes are unaffected, since /c/... is a legitimate absolute path there.

The single resolved _root field corrects every downstream use (directory creation, content source, git clone/sync).

omnydrive

No change required — the sibling package never converts path styles or prepends drive letters; it stores and uses the already-resolved root verbatim. Fixing _root in omnyshell is necessary and sufficient.

Verification

  • dart format (no changes) and dart analyze (no issues).
  • windowsPathFromMsys test suite passes (covers /c/Users/xC:\Users\x and leaves non-drive paths unchanged).

🤖 Generated with Claude Code

`drive mount <node>:/c/Users/foo/dir-x` sent the MSYS/Git-Bash style root to
the node verbatim. On Windows `dart:io` treats `/c/...` as relative to the
current drive, so the mirror was created at `C:\c\Users\foo\dir-x` (surfacing
as `/c/c/Users/foo/dir-x`) instead of `C:\Users\foo\dir-x`.

NodeDriveService now applies the existing `windowsPathFromMsys` helper to the
mount root (guarded by `Platform.isWindows`), mirroring the shell-exec
backends. POSIX nodes are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gmpassos gmpassos merged commit f1407ab into master Jun 21, 2026
5 checks passed
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