Skip to content

fix: hide the background updater console window on Windows - #1336

Merged
liruifengv merged 1 commit into
mainfrom
fix/windows-update-hide-console
Jul 3, 2026
Merged

fix: hide the background updater console window on Windows#1336
liruifengv merged 1 commit into
mainfrom
fix/windows-update-hide-console

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

Follow-up to #1332, addressing a review comment on the Windows upgrade fix.

Problem

#1332 made the Windows upgrade/auto-update spawn the package-manager .cmd shim through a shell (shell: true) to avoid spawn EINVAL. The background auto-update path runs that shell with detached: true and the default windowsHide: false. On Windows a detached child gets its own console window, so a passive background update could flash a command window even though stdio is ignored — defeating the silent updater.

What changed

Set windowsHide: true on win32 for the detached background install spawn only, so the silent updater stays silent. The foreground kimi upgrade path is interactive (stdio: inherit, non-detached) and reuses the parent console, so it does not pop a window and is left unchanged. Added a win32 test covering the background spawn options, plus a changeset.

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.

A detached Windows child gets its own console window. With the shell: true introduced for the CVE-2024-27980 fix, a passive background auto-update could flash a command window even though stdio is ignored. Set windowsHide on the detached background child so the silent updater stays silent. The foreground `kimi upgrade` path is interactive (stdio: inherit, non-detached) and reuses the parent console, so it is left unchanged.
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3451f97

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 Jul 3, 2026

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

commit: 3451f97

@liruifengv
liruifengv merged commit 4c1d0a1 into main Jul 3, 2026
10 checks passed
@liruifengv
liruifengv deleted the fix/windows-update-hide-console branch July 3, 2026 03:32
@github-actions github-actions Bot mentioned this pull request Jul 3, 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.

1 participant