Skip to content

Conversation

@pschiel
Copy link
Contributor

@pschiel pschiel commented Jan 3, 2026

WIP

issues:

  • git rev-parse --show-toplevel returns E:/x/y forward slash format
  • path.resolve(), path.relative(), realpathSync.native(), realpath (bash) break when git bash (msys) paths are used
    • /d/x within C drive (/c/) results in things like C:\d\x
    • relative paths not working like expected using cross-drive
    • some path matching issues (relative, contains, ..)
    • /tmp inside git bash is something else outside of it
  • tools break using backslash paths (some backslashes get "eaten")
  • escaping hell for agents
  • observed in all win32 native shells

patch tries to fix:

  • convert to forward slash format at all places where things break (tool calls and bash mostly)
  • in Filesystem as wrapper functions (path.resolve -> Filesystem.resolvePath)
  • configurable with flag (otherwise backslash paths are guaranteed - but still some bugs with these)

todo:

  • clean up Filesystem functions (relativePath, overlaps, possibly add dirpath)
  • add tests for Filesystem
  • maybe change flag with SHELL detection
  • test all tools, incl. permission checks

@pschiel pschiel force-pushed the windows-posix-paths branch 2 times, most recently from 032638f to 61531f5 Compare January 9, 2026 20:17
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Hey! Your PR title (feat) support MSYS forward slashes with experimental flag doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@pschiel pschiel force-pushed the windows-posix-paths branch 3 times, most recently from adf2edd to 9b205c2 Compare January 11, 2026 04:37
@pschiel pschiel changed the title (feat) support MSYS forward slashes with experimental flag feat: support MSYS forward slashes with experimental flag Jan 11, 2026
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@pschiel pschiel force-pushed the windows-posix-paths branch from 9b205c2 to bef6a68 Compare January 11, 2026 17:38
@Hona Hona self-requested a review January 11, 2026 20:25
@Hona
Copy link
Collaborator

Hona commented Jan 11, 2026

This sounds perfect @pschiel

If you can get it ready and finish the cleanup you said I can test and approve.

Btw don't put it behind an experimental flag. We'll ship once it's working.

@pschiel pschiel force-pushed the windows-posix-paths branch from bef6a68 to 66a84bb Compare January 12, 2026 22:16
@pschiel pschiel force-pushed the windows-posix-paths branch from 66a84bb to 85964a9 Compare January 13, 2026 22:31
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.

2 participants