fix: windows .cmd spawn requires shell: true#9
Closed
shishiv wants to merge 2 commits into
Closed
Conversation
on windows, npm global binaries are .cmd wrappers. child_process.spawn can't execute them directly without shell: true — so trySpawn always returns false even when gitnexus is correctly installed and on PATH. this causes a false-positive 'gitnexus not on PATH' warning on every session_start and session_switch. four spawn sites patched: - trySpawn (binary probe) in index.ts - status command spawn in index.ts - analyze command spawn in index.ts - runAugment in gitnexus.ts fix is shell: process.platform === 'win32' on all four — no-op on mac/linux, fixes the issue on windows. all 46 tests pass.
mcp-client.ts spawns `gitnexus mcp` to start the MCP server — the most critical spawn site, missed by the initial fix. without this, all gitnexus_* tools fail with ENOENT on windows even after the other four spawn sites were patched. this is the fifth spawn site. now all spawn calls have shell: process.platform === 'win32'.
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, npm global binaries are
.cmdwrappers.child_process.spawncan't execute them directly — needsshell: true. without it,trySpawnalways returns false even whengitnexusis correctly installed and on PATH, so every session start/switch fires the "gitnexus not on PATH" warning.five spawn sites affected (initial commit had four; fifth added in follow-up):
trySpawn(binary probe) inindex.tsstatuscommand spawn inindex.tsanalyzecommand spawn inindex.tsrunAugmentingitnexus.tsMcpClient.start()inmcp-client.ts← most critical: spawnsgitnexus mcpto open the MCP server. without this fix, allgitnexus_*tools fail with ENOENT on windows even after the other four sites are patched.fix is
shell: process.platform === 'win32'on all five — no-op on mac/linux, fixes the issue on windows.verified locally: probe returns
exit: 0, version: 1.6.3after the fix. MCP server handshake confirmed. augment enrichments also work now (were silently failing for the same reason).tests