-
Notifications
You must be signed in to change notification settings - Fork 9.1k
fix(win32): path handling #11897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
fix(win32): path handling #11897
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: I can see the PR file, but the title and description are both just "ignore", which doesn't provide meaningful keywords to search for duplicates. Could you provide the actual PR title and description? This will help me search for potentially related or duplicate PRs effectively. |
…ndows # Conflicts: # packages/opencode/src/pty/index.ts # packages/opencode/src/tool/skill.ts
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
This reverts commit 77a1ef2.
~75% of this PR is test code
From the new architecture tests to help force pit of success down the line:
For me to manually test each one by one:
Fixes
Core Path Normalization
test/lsp/document-symbol-paths.test.ts→ "windows: converts file:// URI to drive-letter path"test/tool/diagnostics-paths.test.ts→ "accepts posix diagnostics keys", "windows: accepts canonical diagnostics keys"test/tool/glob-paths.test.ts→ "windows: accepts MSYS-style absolute search paths"test/tool/grep-paths.test.ts→ "windows: accepts MSYS-style absolute search paths"test/util/path.test.ts→ "converts Git Bash / MSYS paths", "normalize() converts MSYS roots"test/tool/bash.test.ts→ "resolves relative workdir against Instance.directory", "throws on invalid workdir"test/server/pty.test.ts→ "throws for invalid cwd"test/tool/bash-paths.test.ts→ "converts MSYS paths to drive-letter posix", "preserves UNC shares"test/tool/external-directory.test.ts→ "windows: normalizes MSYS-style absolute targets"test/permission/next.test.ts→ "evaluate - matches stored backslash patterns", "evaluate - matches case-insensitively"test/util/path.test.ts→ "normalizes standard paths", "joins with forward slashes", "resolve() output contains no backslashes", "handles mixed slashes"test/util/no-native-path-imports.test.ts→ "repo source avoids native path imports"test/worktree/worktree-paths.test.ts→ "remove matches worktrees case-insensitively", "reset blocks primary workspace case-insensitively"test/tool/bash-paths.test.ts→ "converts MSYS paths to drive-letter posix"test/util/path.test.ts→ "converts Git Bash / MSYS paths"test/tool/bash.test.ts→ "asks for external_directory permission even when PATH is broken"test/server/session-list.test.ts→ "filters by directory with trailing separator"test/project/instance-paths.test.ts→ "canonicalizes short and long paths to same directory"test/permission/next.test.ts→ "fromConfig - normalizes windows-style backslashes for path permissions", "fromConfig - normalizes MSYS roots for path permissions", "evaluate - matches stored backslash patterns for path permissions", "evaluate - matches case-insensitively for path permissions"test/tool/edit-paths.test.ts→ "windows: accepts MSYS-style absolute file paths"test/tool/write-paths.test.ts→ "windows: accepts MSYS-style absolute file paths"test/tool/multiedit-paths.test.ts→ "windows: accepts MSYS-style absolute file paths"LSP & Ripgrep
test/lsp/document-symbol-paths.test.ts→ "windows: converts file:// URI to drive-letter path"test/lsp/index.test.ts→ "skips servers with invalid roots"test/tool/diagnostics-paths.test.ts→ "accepts posix diagnostics keys", "windows: accepts canonical diagnostics keys"test/tool/grep-paths.test.ts→ "windows: accepts MSYS-style absolute search paths"test/file/ripgrep.test.ts(updated with toPosix)Glob/File Operations
test/config/config.test.ts→ "windows: handles file inclusion substitution with MSYS absolute paths"test/util/filesystem.test.ts→ "globUp() returns posix absolute paths on Windows"commands/directory not recognized on Windows, onlycommand/works #9335test/config/config.test.ts→ "windows: loads commands when instance directory is MSYS path"test/tool/diagnostics-paths.test.ts→ "accepts posix diagnostics keys", "windows: accepts canonical diagnostics keys"test/tool/edit-paths.test.ts→ "windows: accepts MSYS-style absolute file paths"test/util/path.test.ts→ "windows: converts extended-length drive paths", "windows: converts extended-length UNC paths"test/tool/bash-paths.test.ts→ "never returns backslashes"Permission/Security
test/file/path-traversal.test.ts→ "windows: blocks cross-drive paths", "windows: treats UNC shares as distinct roots"test/permission/next.test.ts→ "fromConfig - normalizes windows-style backslashes for path permissions", "fromConfig - normalizes MSYS roots for path permissions", "evaluate - matches stored backslash patterns for path permissions", "evaluate - matches case-insensitively for path permissions"New Test Files Added (16)
test/lsp/document-symbol-paths.test.tstest/lsp/index.test.tstest/project/instance-paths.test.tstest/server/pty.test.tstest/session/prompt.test.tstest/tool/bash-paths.test.tstest/tool/diagnostics-paths.test.tstest/tool/edit-paths.test.tstest/tool/glob-paths.test.tstest/tool/grep-paths.test.tstest/tool/lsp-paths.test.tstest/tool/multiedit-paths.test.tstest/tool/write-paths.test.tstest/util/no-native-path-imports.test.tstest/util/path.test.tstest/worktree/worktree-paths.test.ts