Skip to content

fix(kaos): hide console window for spawned commands on Windows - #957

Merged
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:fix/kaos-windows-console
Jun 22, 2026
Merged

fix(kaos): hide console window for spawned commands on Windows#957
sailist merged 1 commit into
MoonshotAI:mainfrom
sailist:fix/kaos-windows-console

Conversation

@sailist

@sailist sailist commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — this is a small bug fix.

Problem

On Windows, every command the agent runs spawns a visible empty console window that flashes on screen. child_process.spawn defaults windowsHide to false, so Node allocates a visible console for each child process. POSIX is unaffected.

What changed

  • Pass windowsHide: true in the spawn options so child processes no longer create a visible console window on Windows.
  • Extract the spawn-options construction into a shared helper used by both exec and execWithEnv, keeping the behavior consistent across both code paths.
  • Add regression coverage that asserts the spawn options include windowsHide: true and keep detached platform-conditional.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

- add windowsHide:true to spawn options so commands do not flash a console on Windows
- extract buildLocalSpawnOptions helper shared by exec and execWithEnv
- add regression coverage for the Windows console-window behavior
@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4de9411

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 22, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@4de9411
npx https://pkg.pr.new/@moonshot-ai/kimi-code@4de9411

commit: 4de9411

@itxaiohanglover itxaiohanglover left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix — windowsHide: true is the correct Node.js option to prevent console window flashing on Windows. Extracting buildLocalSpawnOptions as a helper is reasonable since it centralizes the platform-specific spawn config. Changeset included.

@sailist
sailist merged commit b57fc90 into MoonshotAI:main Jun 22, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants