Skip to content

fix(windows): add windowsHide to all spawn sites to prevent periodic console flash - #927

Open
grim-susemi wants to merge 5 commits into
code-yeongyu:mainfrom
grim-susemi:fix/windows-hide-periodic-flash
Open

fix(windows): add windowsHide to all spawn sites to prevent periodic console flash#927
grim-susemi wants to merge 5 commits into
code-yeongyu:mainfrom
grim-susemi:fix/windows-hide-periodic-flash

Conversation

@grim-susemi

@grim-susemi grim-susemi commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

문제

Windows에서 주기적으로 senpi 이름의 콘솔 창이 깜빡이는 현상 보고.

원인

child_process.spawnwindowsHide: true가 빠진 모든 spawn 지점에서 Windows가 conhost 창을 순간적으로 생성한다. 기존 코드에서는 hooks/command-runner.ts, core/tools/bash.ts 등 일부에만 windowsHide가 적용되어 있고, 아래 지점들은 누락되어 있었다:

  • packages/coding-agent/src/cli.ts — 메인 진입 재-spawn
  • packages/coding-agent/src/core/exec.ts — 범용 execCommand
  • packages/coding-agent/src/core/tools/find.ts, grep.ts — fd/rg 헬퍼
  • packages/coding-agent/src/modes/app-server/daemon.ts — app-server 데몬
  • packages/coding-agent/src/modes/rpc/rpc-client.ts — RPC child
  • packages/coding-agent/src/utils/open-browser.ts — 브라우저 런처
  • packages/coding-agent/src/self-update-bootstrap.ts — npm 업데이트 스텝
  • packages/coding-agent/src/modes/interactive/external-editor.ts — 외부 에디터
  • packages/coding-agent/src/beta/omo-local-update-worker.ts — detached worker (detached:true 와 함께여도 windowsHide 필요)

주기성 자체는 정상 동작일 수 있다 (예: app-server 데몬 health-check / LSP 데몬 ensure, senpi update 백그라운드 worker 등) — 기능은 유지하되 창을 숨긴다.

수정

누락된 모든 spawn 호출에 windowsHide: true 추가. detached: true가 있는 곳도 Windows에서는 windowsHide가 별도로 필요하다.

검증

  • 로컬 패치 후 senpi --help 정상
  • grep -rn windowsHide packages/coding-agent/src 로 전체 커버리지 확인
  • 재현: Windows에서 백그라운드 동작 시 콘솔 플래시 제거

영향

Windows 전용 동작만 변경, 다른 플랫폼 영향 없음.


Summary by cubic

Prevents periodic console flashes on Windows by hiding all child processes. Previously some spawns briefly opened a conhost window; now every spawn site sets windowsHide:true and the central wrappers enforce it on win32.

  • Central enforcement: utils/child-process.ts forces windowsHide:true for spawnProcess/spawnProcessSync on win32 unless a caller passes windowsHide:false (propagated through cross-spawn).
  • Site coverage: adds windowsHide:true to remaining direct spawn/spawnSync/execFile calls across the CLI re-spawn, core exec/package manager, git probes, app-server daemon, RPC client, browser launcher, self-update flows, external editor, interactive helpers (tmux, gh, trash), extensions (Cursor OAuth probes, MCP diagnostics), and utilities (wl-copy, xattr/setfattr, which, --version probes); detached spawns now also hide on Windows.
  • Types: Cursor OAuth VersionProbeOptions accepts windowsHide.
  • Behavior unchanged off Windows.
  • No migration. To intentionally show a console on Windows, pass windowsHide:false when calling spawnProcess/spawnProcessSync or in direct spawn/execFile options.

Written for commit 5628f5b. Summary will update on new commits.

Review in cubic

grim-susemi and others added 2 commits August 18, 2026 16:51
…console flash

Every spawn without windowsHide briefly creates a visible conhost window
on Windows. This adds windowsHide:true to all remaining Node child_process
spawn sites that were missing it, matching the existing convention in
hooks/command-runner.ts and core/tools/bash.ts:

- cli.ts (main entry re-spawn)
- core/exec.ts (generic execCommand)
- core/tools/find.ts, grep.ts (fd / rg helpers)
- modes/app-server/daemon.ts (app-server daemon)
- modes/rpc/rpc-client.ts (RPC child)
- utils/open-browser.ts (browser launcher)
- self-update-bootstrap.ts (npm update step)
- modes/interactive/external-editor.ts (external editor)
- beta/omo-local-update-worker.ts (detached worker)

Fixes periodic 'senpi' terminal window flash reported on Windows.
Previous commit covered 10 spawn sites but left the central wrapper
and ~22 additional sites uncovered, so periodic console flashes
could still recur on Windows.

- utils/child-process.ts: centralize enforcement — spawnProcess/
  spawnProcessSync now force windowsHide:true on win32 unless caller
  explicitly opts out (windowsHide:false), with cross-spawn
  parsed.options propagation
- config.ts, package-manager-cli.ts, core/package-manager.ts:
  spawnProcess/SpawnSync wrappers now pass windowsHide
- core/footer-data-provider.ts: git spawnSync/execFile
- utils/{clipboard-image,clipboard,paths,shell,tools-manager}.ts:
  auxiliary spawns (xattr/setfattr/which/--version/wl-copy)
- core/extensions/builtin/{cursor-cli-oauth/*,mcp/diagnose.ts}:
  version probes and MCP diagnostics
- modes/interactive/{interactive-mode.ts,components/session-selector.ts}:
  tmux/gh/trash helpers

Total src call sites 40/40 with windowsHide in ±12-line window
(RED 22 on branch before this commit → GREEN 0). Non-Windows
behavior unchanged — win32 guard preserves original options on POSIX.
@grim-susemi
grim-susemi force-pushed the fix/windows-hide-periodic-flash branch from 110588c to fa1de2f Compare August 18, 2026 07:51
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