Skip to content

Windows: missing windowsHide in exec spawn paths causes console window flashes #58566

@ChristianNyamekye

Description

@ChristianNyamekye

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions