Description:
When trying to run the extension on Windows, it fails to start OpenCode.
First, it throws an ENOENT error. If the user installed the CLI globally via npm, Windows generates an opencode.cmd wrapper. Node's child_process.spawn cannot execute .cmd files directly without the shell enabled, so it looks for an .exe and fails.
If a user manually patches the extension to target opencode.cmd, it then throws an EINVAL error because Node requires the Windows command shell (cmd.exe) to interpret batch scripts.
Steps to Reproduce:
Install opencode-ai globally via npm on Windows.
Attempt to run the VS Code extension.
Observe the Failed to start OpenCode: spawn opencode ENOENT error.
Suggested Fix:
In dist/extension.js (and the source TypeScript file), add the shell option conditionally for Windows users within the spawn configuration. This allows Node to properly execute the npm .cmd wrapper without breaking macOS/Linux behavior.
the windows extension should be like
JavaScript (
const proc = node_child_process.spawn(`opencode.cmd`, args, {//add .cmd
shell: true,// add this param
signal: options.signal,
env: {
...process.env,
OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {})
}
});
Dropping that in his issues tab will save him a lot of debugging time and save every other Windows user from having to manually patch their extension.js file!
for more info:
https://gemini.google.com/share/e7e9a83f9a89
Description:
When trying to run the extension on Windows, it fails to start OpenCode.
First, it throws an ENOENT error. If the user installed the CLI globally via npm, Windows generates an opencode.cmd wrapper. Node's child_process.spawn cannot execute .cmd files directly without the shell enabled, so it looks for an .exe and fails.
If a user manually patches the extension to target opencode.cmd, it then throws an EINVAL error because Node requires the Windows command shell (cmd.exe) to interpret batch scripts.
Steps to Reproduce:
Install opencode-ai globally via npm on Windows.
Attempt to run the VS Code extension.
Observe the Failed to start OpenCode: spawn opencode ENOENT error.
Suggested Fix:
In dist/extension.js (and the source TypeScript file), add the shell option conditionally for Windows users within the spawn configuration. This allows Node to properly execute the npm .cmd wrapper without breaking macOS/Linux behavior.
the windows extension should be like
JavaScript (
Dropping that in his issues tab will save him a lot of debugging time and save every other Windows user from having to manually patch their extension.js file!
for more info:
https://gemini.google.com/share/e7e9a83f9a89