Bug: Windows async ask fails due to DETACHED_PROCESS flag
Environment
- OS: Windows 11
- Terminal: WezTerm
- Shell: PowerShell
Description
On Windows, async ask <provider> "message" never completes — tasks stay in submitted/spawned state forever. --foreground mode works fine.
Root Cause
bin/ask uses DETACHED_PROCESS (0x00000008) in creationflags when spawning the PowerShell script. This causes PowerShell to exit immediately without executing the script because it has no console.
Fix
Remove DETACHED_PROCESS from creationflags. CREATE_NO_WINDOW is sufficient to hide the console window.
- creationflags=DETACHED_PROCESS | CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP,
+ creationflags=CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP,
Two locations in bin/ask need updating (~lines 663 and 725).
Verification
Tested with and without DETACHED_PROCESS:
- With: PowerShell exits immediately, script never runs
- Without: Script executes normally, async ask works end-to-end
Bug: Windows async
askfails due toDETACHED_PROCESSflagEnvironment
Description
On Windows, async
ask <provider> "message"never completes — tasks stay insubmitted/spawnedstate forever.--foregroundmode works fine.Root Cause
bin/askusesDETACHED_PROCESS(0x00000008) increationflagswhen spawning the PowerShell script. This causes PowerShell to exit immediately without executing the script because it has no console.Fix
Remove
DETACHED_PROCESSfromcreationflags.CREATE_NO_WINDOWis sufficient to hide the console window.Two locations in
bin/askneed updating (~lines 663 and 725).Verification
Tested with and without
DETACHED_PROCESS: