opencode
opencode copied to clipboard
feat: support MSYS forward slashes with experimental flag
WIP
issues:
-
git rev-parse --show-toplevelreturnsE:/x/yforward slash format -
path.resolve(),path.relative(),realpathSync.native(),realpath(bash) break when git bash (msys) paths are used-
/d/xwithin C drive (/c/) results in things likeC:\d\x - relative paths not working like expected using cross-drive
- some path matching issues (relative, contains, ..)
-
/tmpinside 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 adddirpath) - add tests for Filesystem
- maybe change flag with SHELL detection
- test all tools, incl. permission checks