fix(windows): resolve and safely launch npm shims - #678
Open
css521 wants to merge 4 commits into
Open
Conversation
One conflict, in jean-core/src/prerequisites.rs::version(): this branch swapped silent_command() for path_tool_command() so Windows resolves npm.cmd (issue coollabsio#675), while main only reformatted the same expression with rustfmt. Both changes kept — the new helper inside main's formatting. Checked that main introduced no new npm/npx launch sites that would also need routing through path_tool_command(); the remaining silent_command() callers launch git, sh, wsl.exe, xattr and friends, which are unaffected.
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.
Summary
.exe,.cmd, or.batcandidates before spawningstd::processfor safe per-argument escaping, full command quoting, andcmd.exe /dcmd.exe /Claunch mode for agent backends whose Windows.cmdshims receive multiline chat prompts, because Rust's native batch path rejects CR/LF arguments.cmdredirection, spaced shim paths, launch planning, allowlisting, and bare npm/npx auditsCloses #675.
Validation
cd jean-core && cargo test -- platform::wsl(34 passed)cd jean-core && cargo test -- windows_path_detection allowlist_key path_tool_command npm_and_npx_are_never_spawned_as_bare_program_names(10 passed)rustfmt --edition 2021 --check jean-core/src/platform/wsl.rs jean-core/src/platform/cli_detect.rsnpx --yes prettier --check docs/developer/architecture-guide.mdgit diff --check