Windows: spawned console subprocesses flash visible windows that steal focus (windowsHide not set)
#4231
PianoPrince
started this conversation in
General
Replies: 1 comment
|
I put together a focused reference implementation for the central
It sets This is intentionally a bounded fix, not a claim that every separate Web browser-helper, CLI, or probe launch site listed above has been swept. Verification on Windows with Node 24.19:
Thanks @PianoPrince for the clear report and local reproduction; the commit message credits Discussion #4231 explicitly. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
When the DSH server runs without its own console (started detached / autostart), every subprocess it spawns gets a visible console window on Windows that steals foreground focus — most noticeably each
pwsh -NoLogo -NoProfile -NonInteractive -Command …call from the PowerShell tool, plus another flash when the tree is killed viataskkill.Node only allocates a visible console when the parent has no console and the spawn doesn't opt out, so this hits exactly the headless/detached setups.
Environment
@deepseek-ai/dsh@0.1.1-rc.2(web mode)Popen([node, lib/bin.js, "web"], creationflags=DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP)Root cause
Some packages already pass
windowsHide: true(dsh-native-command,dsh-host-directory-picker-native), but the main executor paths don't:@deepseek-ai/dsh-subprocess-local/lib/index.js← main onespawnSubprocess()— hot path for thepwsh/bashtools, LSP stdio, terminals, sandbox runnertaskkillTree()/taskkillProcessTree()— flashes on every teardown/timeout killDEFAULT_INTERNALS.exec— Windows process inspector@deepseek-ai/dsh-web-app/lib/index.js—spawnBrowserLauncher()@deepseek-ai/dsh/lib/plugin-*.js—spawnSync("pnpm", …)@deepseek-ai/dsh-sandbox-local/lib/index.js— probe helpersSuggested fix
Add
windowsHide: trueto those option objects (ignored on POSIX, safe unconditionally). Fixing it inLocalSubprocessRuntime's singlespawn()site covers all shell/LSP/sandbox executors at once.Verified locally on 0.1.1-rc.2: windows are gone, no change to stdio capture, tree termination, timeouts, or exit handling.
Happy to send a PR if helpful.
All reactions