MoonshotAI / MoonshotAI/kimi-code
[Windows] statusLine spawn lacks windowsHide — visible console popup steals focus on every refresh
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Environment
- OS: Windows 11 (Chinese locale), Windows Terminal set as default terminal
- kimi-code: 0.39.0
- User config: custom
statusLinecommand (a shell script), plus hooks
Symptom
Every statusline refresh spawns a visible console window (titled as a console host popup, hosted by Windows Terminal) that steals keyboard focus. With a custom statusLine this fires every few seconds, making the TUI nearly unusable.
Root cause (from source, v0.39.0)
The main hook/Bash spawn paths were fixed in #957 / #1466 (windowsHide → libuv CREATE_NO_WINDOW), but the statusline path was missed:
apps/kimi-code/src/tui/utils/status-line-command.ts:46— spawnscmd /d /s /c <statusline command>withoutwindowsHide- same file, line ~62 — the timeout
taskkillspawn also lackswindowsHide
Same batch of remaining spawns missing windowsHide (worth auditing together):
packages/agent-core/src/services/fs/fsSearchService.ts:183apps/kimi-code/src/utils/clipboard/clipboard-common.ts:73- MCP stdio servers via
StdioClientTransport(one flash per server start)
Evidence
Process-monitor capture at popup timestamps shows cmd.exe /d /s /c "...statusline.sh" parented to the kimi TUI process at each popup moment, 1:1.
Mechanism (verified by reproduction)
On Windows, when a parent process has no console and spawns a console-subsystem program without CREATE_NO_WINDOW, the OS allocates a new console, which the default terminal (Windows Terminal) surfaces as a popup window. Adding windowsHide: true fixes it — same pattern as #1466.
Impact
Any Windows user with a custom statusLine (or an MCP server via cmd) gets focus-stealing popups continuously. Especially confusing for non-technical users.
Local workaround (in case it helps triage)
We redirected ComSpec to a GUI-subsystem cmd shim so all shell-outs go through a windowless proxy (byte-level transparent). Works, but it's a user-side hack — the real fix belongs in these spawn sites.
Happy to test a nightly build.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/kimi-code/src/tui/utils/status-line-command.ts and compare its statusline and timeout spawns with the windowsHide pattern from #1466. Check the remaining spawn sites named in packages/agent-core/src/services/fs/fsSearchService.ts, apps/kimi-code/src/utils/clipboard/clipboard-common.ts, and MCP StdioClientTransport. Done means Windows statusline refreshes and listed shell-outs no longer create focus-stealing console popups.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100