openclaw - ✅(Solved) Fix Windows: missing windowsHide in exec spawn paths causes console window flashes [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#58566Fetched 2026-04-08 02:01:00
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1cross-referenced ×1locked ×1

On Windows, the runCommandWithTimeout and runExec functions in exec-CLVZ7JOg.js (source: src/process/exec.ts) spawn child processes via child_process.spawn() and child_process.execFile() without setting windowsHide: true. This causes a brief black console window flash every time an agent executes a tool command.

Other spawn sites in the codebase correctly set windowsHide: true:

  • ACP client spawn (acp-cliresolveWindowsSpawnProgram propagates windowsHide)
  • Process supervisor (auth-profiles line ~40339 → windowsHide: true)
  • Scheduled task restart (windows-task-restartwindowsHide: true)

But the two most frequently called exec paths do not:

Root Cause

On Windows, the runCommandWithTimeout and runExec functions in exec-CLVZ7JOg.js (source: src/process/exec.ts) spawn child processes via child_process.spawn() and child_process.execFile() without setting windowsHide: true. This causes a brief black console window flash every time an agent executes a tool command.

Other spawn sites in the codebase correctly set windowsHide: true:

  • ACP client spawn (acp-cliresolveWindowsSpawnProgram propagates windowsHide)
  • Process supervisor (auth-profiles line ~40339 → windowsHide: true)
  • Scheduled task restart (windows-task-restartwindowsHide: true)

But the two most frequently called exec paths do not:

Fix Action

Workaround

Manually patching the dist file to add windowsHide: true to both sites. Gets overwritten on openclaw update.

PR fix notes

PR #59466: [codex] Hide Windows exec console windows

Description (problem / solution / changelog)

Summary

This hides Windows console windows for the main exec code paths used by OpenClaw tools and command runners.

Root Cause

runExec and runCommandWithTimeout spawned Windows child processes without windowsHide: true. That caused brief visible console windows even though similar process launch sites elsewhere in the codebase were already hidden.

Changes

  • add windowsHide: true to both Windows execFile paths in runExec
  • add windowsHide: true to the spawn path in runCommandWithTimeout
  • keep the existing .cmd wrapping, npm shim resolution, and windowsVerbatimArguments behavior unchanged
  • add regression tests that assert the hidden-window option across wrapped, shimmed, and direct Windows execution paths

Validation

  • pnpm exec vitest run src/process/exec.windows.test.ts

Notes

  • Windows manual verification is still recommended to confirm there is no visible console flash in a real desktop session.

Fixes #58566

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/process/exec.ts (modified, +3/-2)
  • src/process/exec.windows.test.ts (modified, +31/-0)

Code Example

// src/process/exec.ts — runCommandWithTimeout
const child = spawn(..., {
    stdio,
    cwd,
    env: resolvedEnv,
    windowsVerbatimArguments: ...,
    // ❌ missing: windowsHide: true
});

---

// src/process/exec.ts — runExec
await execFileAsync(process.env.ComSpec ?? "cmd.exe", [...], {
    ...options,
    windowsVerbatimArguments: true,
    // ❌ missing: windowsHide: true
});
// and the non-batch path:
await execFileAsync(execCommand, execArgs, options);
// ❌ also missing windowsHide: true
RAW_BUFFERClick to expand / collapse

Summary

On Windows, the runCommandWithTimeout and runExec functions in exec-CLVZ7JOg.js (source: src/process/exec.ts) spawn child processes via child_process.spawn() and child_process.execFile() without setting windowsHide: true. This causes a brief black console window flash every time an agent executes a tool command.

Other spawn sites in the codebase correctly set windowsHide: true:

  • ACP client spawn (acp-cliresolveWindowsSpawnProgram propagates windowsHide)
  • Process supervisor (auth-profiles line ~40339 → windowsHide: true)
  • Scheduled task restart (windows-task-restartwindowsHide: true)

But the two most frequently called exec paths do not:

1. runCommandWithTimeout (spawn)

// src/process/exec.ts — runCommandWithTimeout
const child = spawn(..., {
    stdio,
    cwd,
    env: resolvedEnv,
    windowsVerbatimArguments: ...,
    // ❌ missing: windowsHide: true
});

2. runExec (execFile)

// src/process/exec.ts — runExec
await execFileAsync(process.env.ComSpec ?? "cmd.exe", [...], {
    ...options,
    windowsVerbatimArguments: true,
    // ❌ missing: windowsHide: true
});
// and the non-batch path:
await execFileAsync(execCommand, execArgs, options);
// ❌ also missing windowsHide: true

Expected behavior

All child process spawns on Windows should use windowsHide: true to prevent console window flashes, consistent with the rest of the codebase.

Environment

  • Windows 11 Pro
  • OpenClaw 2026.3.28
  • Node 24.13.0
  • Gateway running via gateway-silent.vbs (window style 0)

Workaround

Manually patching the dist file to add windowsHide: true to both sites. Gets overwritten on openclaw update.

extent analysis

TL;DR

Add windowsHide: true to the options of child_process.spawn() and child_process.execFile() in exec.ts to prevent console window flashes on Windows.

Guidance

  • Identify the two functions runCommandWithTimeout and runExec in exec.ts and add windowsHide: true to their respective options objects.
  • Verify the fix by running the application on Windows and checking for the absence of console window flashes.
  • Consider implementing a more permanent solution, such as modifying the source code or creating a custom patch, to avoid overwriting the fix on openclaw update.

Example

// src/process/exec.ts — runCommandWithTimeout
const child = spawn(..., {
    stdio,
    cwd,
    env: resolvedEnv,
    windowsVerbatimArguments: ...,
    windowsHide: true, // add this line
});

// src/process/exec.ts — runExec
await execFileAsync(process.env.ComSpec ?? "cmd.exe", [...], {
    ...options,
    windowsVerbatimArguments: true,
    windowsHide: true, // add this line
});

Notes

This solution assumes that adding windowsHide: true to the options objects will prevent the console window flashes without introducing any other issues. However, this may not be the case, and further testing is recommended to verify the fix.

Recommendation

Apply the workaround by adding windowsHide: true to the options objects, as this is a straightforward and targeted solution to the problem. A more permanent solution, such as modifying the source code, may be necessary to avoid overwriting the fix on openclaw update.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

All child process spawns on Windows should use windowsHide: true to prevent console window flashes, consistent with the rest of the codebase.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Windows: missing windowsHide in exec spawn paths causes console window flashes [1 pull requests, 1 participants]