Port upstream PR #329: Hide CLI console window on Windows#28
Conversation
Add explicit PIPE redirect configuration to ProcessBuilder in spawn-cli, ensuring the JVM sets CREATE_NO_WINDOW on Windows. This prevents a console window from appearing when spawning the CLI from GUI applications. The JVM's ProcessImpl already uses CREATE_NO_WINDOW when all stdio handles are pipes (not inherited from parent console). Making the PIPE redirects explicit documents this intent and protects against regressions. Co-authored-by: krukow <3635+krukow@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR ports upstream PR #329, which adds automatic hiding of the CLI console window on Windows when spawning the CLI subprocess from GUI applications. While the upstream Node.js SDK added an explicit windowsHide: true option, the JVM already provides this behavior through OpenJDK's ProcessImpl_md.c, which sets CREATE_NO_WINDOW when all stdio handles use PIPE redirects (not INHERIT).
Changes:
- Made PIPE redirects explicit in
spawn-clito ensure Windows console hiding and document the intent - Added CHANGELOG entry documenting the upstream sync
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/github/copilot_sdk/process.clj | Added explicit PIPE redirects for stdin/stdout/stderr with detailed comments explaining the Windows CREATE_NO_WINDOW behavior |
| CHANGELOG.md | Added entry under "Added (upstream PR #329 sync)" documenting the Windows console window hiding feature |
krukow
left a comment
There was a problem hiding this comment.
Reviewed PR #28. I don't see any blocking issues: explicit PIPE redirects in process.clj preserve current behavior while making the Windows no-console intent explicit, and the changelog entry accurately documents the upstream parity.
Upstream PR #329 adds
windowsHide: true(Node.js),CREATE_NO_WINDOW(Python), andSysProcAttr.HideWindow(Go) to prevent a console window flash when spawning the CLI from GUI applications.JVM already handles this — OpenJDK's
ProcessImpl_md.csetsCREATE_NO_WINDOWautomatically when all stdio handles are pipes (not inherited from parent console):Since
ProcessBuilderdefaults toRedirect.PIPEfor all streams, we getCREATE_NO_WINDOWfor free. No JNA needed.process.clj: Add explicitRedirect.PIPEcalls for all three streams — makes the Windows intent self-documenting and guards against regressions if someone later switches a redirect toINHERITCHANGELOG.md: Upstream sync entry for PR #329Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.