fix(process): resolve opencode.exe from PATH directly when no .cmd shim exists#183
Merged
grinev merged 1 commit intoJul 11, 2026
Merged
Conversation
…im exists When opencode is installed via non-npm methods (install script, scoop, choco, manual download), only opencode.exe is on PATH — no .cmd shim exists. The existing code only searched for opencode.cmd, so it fell back to cmd.exe /c opencode, which still shows a visible console window. Fix: add a first pass that checks each PATH entry for opencode.exe directly before falling through to the .cmd resolution logic. Adds a test that isolates PATH to only the temp dir with opencode.exe (no .cmd shim) and asserts the resolved exe path is returned.
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.
Description
When opencode is installed via non-npm methods (official install script, scoop, choco, winget, manual download), only \opencode.exe\ is on PATH — no .cmd\ shim exists. The current code only searches for \opencode.cmd, so for these users it falls back to \cmd.exe /c opencode serve, which still shows a visible console window.
Fix
Added a first pass in
esolveWindowsOpencodeExe()\ that checks each PATH entry for \opencode.exe\ directly. If found, it's used directly with \windowsHide: true. Falls through to the existing .cmd\ logic as before.
Resolution order
Testing
esolves opencode.exe directly from PATH when no .cmd shim exists\ — isolates PATH to a temp dir with only \opencode.exe, asserts the resolved absolute exe path is returned