Summary
On Windows, every spawned sub-process (watcher, Claude CLI child, zeroshot task run) creates a visible cmd.exe or Node.js console window that appears on the user's desktop and taskbar. These windows flash or persist while agents are running, making the tool unusable in a desktop environment.
Root cause
Node.js spawn() and fork() on Windows default to creating a new console window for each child process. This can be suppressed by passing windowsHide: true in the spawn options — but none of the four spawn/fork call sites in zeroshot do this.
Affected files and call sites
| File |
Function |
Type |
task-lib/runner.js |
spawnWatcher() |
fork() |
task-lib/watcher.js |
main child spawn |
spawn() |
src/agent/agent-task-executor.js |
spawnTaskProcess() |
spawn() |
src/claude-task-runner.js |
_spawnAndGetTaskId() |
spawn() |
Fix
Add windowsHide: true to the options object in each of the four call sites above.
task-lib/runner.js — spawnWatcher():
const watcher = fork(
watcherScript,
[id, cwd, logFile, JSON.stringify(finalArgs), JSON.stringify(watcherConfig)],
{
detached: true,
stdio: 'ignore',
windowsHide: true, // add this
}
);
task-lib/watcher.js — main child spawn:
const child = spawn(spawnCmd, spawnFinalArgs, {
cwd,
env,
stdio: ['ignore', 'pipe', 'pipe'],
windowsHide: true, // add this
});
src/agent/agent-task-executor.js — spawnTaskProcess():
const proc = spawn(spawnCmd, spawnArgs, {
cwd,
stdio: ['ignore', 'pipe', 'pipe'],
env: spawnEnv,
windowsHide: true, // add this
});
src/claude-task-runner.js — _spawnAndGetTaskId():
const proc = spawn(spawnCmd, spawnArgs, {
cwd,
stdio: ['ignore', 'pipe', 'pipe'],
env: spawnEnv,
windowsHide: true, // add this
});
Environment
- Windows 11 Pro 10.0.26200
- Node.js (npm global install)
@covibes/zeroshot latest
Additional context
This is part of a broader set of Windows compatibility issues. Related: #457 (spawn ENOENT on Windows for npm global commands).
windowsHide is a no-op on non-Windows platforms, so this change is safe to apply unconditionally.
Summary
On Windows, every spawned sub-process (watcher, Claude CLI child, zeroshot task run) creates a visible cmd.exe or Node.js console window that appears on the user's desktop and taskbar. These windows flash or persist while agents are running, making the tool unusable in a desktop environment.
Root cause
Node.js
spawn()andfork()on Windows default to creating a new console window for each child process. This can be suppressed by passingwindowsHide: truein the spawn options — but none of the four spawn/fork call sites in zeroshot do this.Affected files and call sites
task-lib/runner.jsspawnWatcher()fork()task-lib/watcher.jsspawn()src/agent/agent-task-executor.jsspawnTaskProcess()spawn()src/claude-task-runner.js_spawnAndGetTaskId()spawn()Fix
Add
windowsHide: trueto the options object in each of the four call sites above.task-lib/runner.js—spawnWatcher():task-lib/watcher.js— main child spawn:src/agent/agent-task-executor.js—spawnTaskProcess():src/claude-task-runner.js—_spawnAndGetTaskId():Environment
@covibes/zeroshotlatestAdditional context
This is part of a broader set of Windows compatibility issues. Related: #457 (spawn ENOENT on Windows for npm global commands).
windowsHideis a no-op on non-Windows platforms, so this change is safe to apply unconditionally.