Hide CLI console window on Windows across all SDKs#329
Hide CLI console window on Windows across all SDKs#329SteveSandersonMS merged 5 commits intomainfrom
Conversation
|
@copilot This shouldn't be an option. The SDK should always hide the window. Check this is consistent across all the 4 language SDKs. |
Done! I've made hiding the CLI window the default behavior across all SDKs: Python: Removed the All SDKs now consistently hide the console window on Windows to avoid distracting users in GUI apps. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
|
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
…sertions Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
- Python: Always hide window on Windows (removed hide_cli_window option) - Node.js: Add windowsHide: true to spawn options - Go: Add SysProcAttr with HideWindow on Windows via platform-specific files - .NET: Already had CreateNoWindow = true This ensures consistent behavior across all SDKs where the CLI subprocess console window is hidden on Windows to avoid distracting users in GUI apps. Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>
4ed5407 to
294789f
Compare
294789f to
c89912f
Compare
✅ Cross-SDK Consistency ReviewThis PR maintains excellent cross-SDK consistency by implementing the same feature (hiding CLI console window on Windows) across all four SDK implementations. Implementation SummaryAll SDKs now automatically hide the console window on Windows when spawning the CLI subprocess:
Why This Is Well Done
No Action RequiredThis PR successfully brings all SDKs into alignment. No additional cross-SDK changes are needed. 🎉
|
There was a problem hiding this comment.
Pull request overview
This PR improves Windows GUI/frozen-app UX by ensuring the Copilot CLI subprocess does not pop up a visible console window when auto-started by the SDKs, aligning behavior across Python, Node.js, and Go (with .NET already compliant).
Changes:
- Python: pass
creationflags=subprocess.CREATE_NO_WINDOWon Windows when spawning the CLI. - Node.js: add
windowsHide: trueto the CLIspawnoptions for both.jsand executable CLI paths. - Go: introduce platform-specific
configureProcAttrhelpers to setSysProcAttr.HideWindow = trueon Windows and call it from CLI process startup.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| python/copilot/client.py | Hides Windows console window via creationflags when spawning the CLI subprocess. |
| nodejs/src/client.ts | Ensures spawned CLI process uses windowsHide: true on Windows. |
| go/process_windows.go | Windows-only helper that sets SysProcAttr.HideWindow on the CLI exec command. |
| go/process_other.go | Non-Windows no-op implementation of the process attribute helper. |
| go/client.go | Calls the platform-specific helper before starting the CLI process. |
Windows GUI applications show a console window when the SDK auto-starts the CLI subprocess, breaking the user experience for frozen apps.
Changes
All SDKs now automatically hide the console window on Windows when spawning the CLI subprocess:
subprocess.CREATE_NO_WINDOWflag unconditionally on WindowswindowsHide: truein spawn optionsSysProcAttr.HideWindowvia platform-specific build tagsCreateNoWindow = true(no changes needed)Implementation
Python
Uses conditional kwargs pattern to avoid passing Windows-specific parameters on other platforms:
Node.js
Go
Platform-specific files with build tags:
process_windows.go: SetsSysProcAttr.HideWindow = trueprocess_other.go: No-op on non-Windows platformsBehavior
The console window is now automatically hidden on Windows across all SDKs, ensuring a consistent user experience in GUI applications. No configuration required.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.