Prerequisites
Bug Description
On Windows, a brief sh.exe (Git Bash) console window flashes during tool execution when running via codemie-opencode. This is visually disruptive.
Steps to Reproduce
install https://github.com/waybarrios/opencode-power-pack as on opencode plugin
start codemie: codemie-opencode
Do common work using opencode capabilities
Expected Behavior
No unexpected terminal windows opens and closes during work
Actual Behavior
Periodically you see an sh terminal window
CodeMie CLI Version
0.14.0
Which agent are you using?
Not applicable / General CLI
Which provider are you using?
Not applicable
Model
any model
Node.js Version
v24.19.0
Operating System
Windows (native)
Configuration (Redacted)
{
"version": 2,
"activeProfile": "default",
"profiles": {
"default": {
"provider": "ai-run-sso",
"codeMieUrl": ",
"codeMieProject": "",
"apiKey": "sso-provided",
"baseUrl": "",
"model": "deepseek-v4-pro",
"haikuModel": "claude-haiku-4-5-20251001",
"sonnetModel": "claude-sonnet-5",
"opusModel": "claude-opus-5",
"name": "default"
}
},
"userEmail": ""
}
Error Logs
Additional Context
Per codemie-opencode investigation:
Root Cause
In shell-hooks-source.js:233, the execCommandAsync() function spawns sh.exe directly without windowsHide: true:
const child = spawn("sh", ["-c", command], {
env: { ...process.env, ...env },
stdio: ["pipe", "ignore", "ignore"],
detached: true,
// ❌ missing: windowsHide: true
});
The detached: true option prevents the child from being attached to the parent console, but on Windows it does not suppress the creation of a new console window for the detached process. The windowsHide: true option is required to prevent the console window from appearing.
Additional Context
- The synchronous
execCommand() at line 210 also uses execSync() without windowsHide (Node.js 16+ supports windowsHide on execSync), though execSync typically inherits the parent hidden window when the parent was spawned with windowsHide: true.
- The
utils/exec.js utility (line 48) already correctly passes windowsHide: true.
- The main process spawn in
BaseAgentAdapter.js:749 already passes windowsHide: true.
Environment
- OS: Windows
- Git Bash provides the
sh.exe binary
- Codemie version: 0.14.0
Fix
Add windowsHide: true to the spawn options in execCommandAsync():
const child = spawn("sh", ["-c", command], {
env: { ...process.env, ...env },
stdio: ["pipe", "ignore", "ignore"],
detached: true,
windowsHide: true, // ✅ suppress console window
});
Prerequisites
Bug Description
On Windows, a brief
sh.exe(Git Bash) console window flashes during tool execution when running viacodemie-opencode. This is visually disruptive.Steps to Reproduce
install https://github.com/waybarrios/opencode-power-pack as on opencode plugin
start codemie:
codemie-opencodeDo common work using opencode capabilities
Expected Behavior
No unexpected terminal windows opens and closes during work
Actual Behavior
Periodically you see an
shterminal windowCodeMie CLI Version
0.14.0
Which agent are you using?
Not applicable / General CLI
Which provider are you using?
Not applicable
Model
any model
Node.js Version
v24.19.0
Operating System
Windows (native)
Configuration (Redacted)
{ "version": 2, "activeProfile": "default", "profiles": { "default": { "provider": "ai-run-sso", "codeMieUrl": ", "codeMieProject": "", "apiKey": "sso-provided", "baseUrl": "", "model": "deepseek-v4-pro", "haikuModel": "claude-haiku-4-5-20251001", "sonnetModel": "claude-sonnet-5", "opusModel": "claude-opus-5", "name": "default" } }, "userEmail": "" }Error Logs
Additional Context
Per codemie-opencode investigation:
Root Cause
In
shell-hooks-source.js:233, theexecCommandAsync()function spawnssh.exedirectly withoutwindowsHide: true:The
detached: trueoption prevents the child from being attached to the parent console, but on Windows it does not suppress the creation of a new console window for the detached process. ThewindowsHide: trueoption is required to prevent the console window from appearing.Additional Context
execCommand()at line 210 also usesexecSync()withoutwindowsHide(Node.js 16+ supportswindowsHideonexecSync), thoughexecSynctypically inherits the parent hidden window when the parent was spawned withwindowsHide: true.utils/exec.jsutility (line 48) already correctly passeswindowsHide: true.BaseAgentAdapter.js:749already passeswindowsHide: true.Environment
sh.exebinaryFix
Add
windowsHide: trueto thespawnoptions inexecCommandAsync():