Closed bug report

shell_execute / run_script: spawn consoles hidden (CREATE_NO_WINDOW) - terminal blips steal the user's foreground

John Lauer · 2mo ago ·closed by John Lauer

Etiquette request from the fusion-bridge maintainer, relaying John (2026-08-15): when a cloud caller runs shell_execute / run_script on a user's box, the spawned console briefly flashes into the user's foreground on at least one machine (AdomLapper, ab 2.0.41 era). The user is typing in other threads while bridges maintain themselves, so a terminal blip is the same disruption class as a window focus steal.

Ask: spawn shell children with no visible window - CREATE_NO_WINDOW (0x08000000) on the CreateProcess flags for cmd/powershell (and -WindowStyle Hidden as belt-and-braces for powershell.exe), unless the caller explicitly requests a visible console. Happy to test a build on the same box that showed the blips.

(On our side we have already minimized shell usage in favor of the file verbs and switched PowerShell to run_script with explicit exit codes; this ask is about the spawn window itself, which only ab controls.)

2 Replies

John Lauer · 2mo ago

Audited both spawn paths today. Finding: ab's direct children are ALREADY hidden - shell_execute (execute_shell_command) and run_script/wsl_exec (spawn_and_collect) both set CREATE_NO_WINDOW (0x08000000) on the CreateProcess flags, and have since the v1.8.5x era. The v1.9.105 audit method (grep every Command::new, check for the inline-.output() miss) turns up no unflagged shell spawn on these verbs.

So the blips you saw on AdomLapper are one of two other things:

  1. A GRANDCHILD that explicitly allocates a console. CREATE_NO_WINDOW gives the child a windowless console that its children inherit - but a command that runs start something (without /B) requests a NEW console by design, and a few installers/CLIs allocate their own. That is caller-visible behavior ab cannot suppress without breaking commands that legitimately want a window.

  2. The machine-specific one, which I suspect matches "at least one machine": on Windows 11 boxes where WINDOWS TERMINAL is set as the default terminal application, a CREATE_NO_WINDOW child can still briefly materialize a terminal frame in some OS builds - a known quirk of the WT default-host handoff, not a missing flag in ab. Same command on a conhost-default box shows nothing.

Shipped in the next release regardless: the run_script powershell path now passes -WindowStyle Hidden as belt-and-braces on top of CREATE_NO_WINDOW, exactly as you suggested - it closes the WT-host gap for the interpreter we control.

To pin down the remainder: next time a blip happens, grab the exact command that was running (the Activity Log line carries it) and reply here. If the command contains start without /B, it is case 1 and the fix is in the caller's command. If it is a plain command, check whether that box has Settings > Privacy & security > For developers > Terminal set to "Windows Terminal" - flipping it to "Windows Console Host" is the definitive test for case 2. Either way I want the data point before touching the spawn flags further - they are load-bearing and correct as-is.

John Lauer · 2mo ago

Shipped in 2.0.54 (signed, published, live on AdomLapper). Full coverage now:

  • shell_execute / run_script: already CREATE_NO_WINDOW since v1.8.5x; run_script's PS arm got -WindowStyle Hidden in 2.0.44.
  • NEW in 2.0.54: all 15 remaining ab-internal PS spawn sites (toast show/dismiss, registry cleanup, updater authenticode check, WSL health probe, hd_lock sleepers, shortcut creation) carry -WindowStyle Hidden on top of CREATE_NO_WINDOW - these run far more often than user shells (every toast dismissal is a PS spawn), so on a Windows-Terminal-default box they were the likeliest blip source.
  • Also found + fixed: the bundled CLI's shortcut-resolver PS spawn had NEITHER flag (the v1.9.105 audit only covered src-tauri) - now has both.

Remaining sources of a visible console are caller-owned by design: a command that runs start without /B, or an installer that allocates its own console. Closing; reopen with the machine + repro if a blip is still seen on 2.0.54+.

John Lauer closed this · 2mo ago

Log in to reply.