Repository navigation
fix: resolve file URL working directories on Windows - #191
Merged
43081j merged 2 commits intoNov 24, 2026
Merged
Conversation
The cwd never changed anyway so the assertion did nothing. The special chars test doesn't need 2 parts.
43081j
force-pushed
the
fix/file-url-working-directory
branch
from
November 24, 2026 21:07
01488ab to
d24546c
Compare
43081j
approved these changes
Nov 24, 2026
Contributor
Author
|
Thanks @43081j for tidying up the tests and merging! The simplified versions are much easier to follow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, passing a file URL as nodeOptions.cwd can prevent relative shebang scripts and local node_modules/.bin commands from running, even when the equivalent string path works.
The environment builder converts the URL with windows: false, which prepends malformed paths such as C:\C:\project\node_modules.bin to PATH. Command resolution separately treats cwd.toString() as a filesystem path, so it searches relative to the literal file:///... value.
Convert file URLs to native paths in both places, while keeping the original cwd value in the options passed to Node. Use a platform-native URL in the existing environment fixture and add regressions for path/URL parity, relative shebang resolution, and async/sync execution from directories containing spaces, Unicode, #, and %.
This follows the URL support introduced in #166. Its existing subprocess check only searches for a path substring, which can also occur inside the malformed Windows path.
Validation on Windows, Node 26.13.1, npm 11.11.0:
Native Linux/macOS, other Node versions, Bun, and English-language Windows were not run locally.
AI assistance: OpenAI Codex (GPT-6) assisted with investigation, implementation, regression tests, and this description.