Skip to content

fix: add shell:true for binaryAvailable on Windows#19

Closed
masayan-kazu wants to merge 1 commit intoopenai:mainfrom
masayan-kazu:fix/windows-spawnsync-shell
Closed

fix: add shell:true for binaryAvailable on Windows#19
masayan-kazu wants to merge 1 commit intoopenai:mainfrom
masayan-kazu:fix/windows-spawnsync-shell

Conversation

@masayan-kazu
Copy link
Copy Markdown

Summary

On Windows, npm and codex are installed as .cmd batch wrappers.
spawnSync without shell: true cannot resolve .cmd extensions,
causing binaryAvailable() to return ENOENT for both.

This makes /codex:setup (and all commands depending on
getCodexAvailability()) report npm as "Missing" and Codex as
"Not installed", even though both are correctly in PATH.

Changes

  • Pass shell option through runCommand to spawnSync
  • Set shell: true on win32 in binaryAvailable only

Testing

Tested on Windows 11 + Claude Code CLI (Git Bash / mingw64):

  • Before: /codex:setup → npm Missing, Codex Not installed
  • After: /codex:setup → npm Available, Codex Available

Fixes #17

spawnSync cannot resolve .cmd wrappers (npm, codex) without shell:true
on Windows, causing /codex:setup to report them as missing.

Fixes openai#17
@masayan-kazu masayan-kazu requested a review from a team March 31, 2026 01:50
@dkundel-openai
Copy link
Copy Markdown
Collaborator

Closing as duplicate of #13. Thanks for the contribution

@masayan-kazu
Copy link
Copy Markdown
Author

Thanks for the heads-up! I didn't notice #13 before filing. Happy to see it's already being tracked.

@masayan-kazu masayan-kazu deleted the fix/windows-spawnsync-shell branch March 31, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/codex:setup reports npm and codex as "Missing" / "Not installed" on Windows (Claude Code + Git Bash)

2 participants