diff --git a/CHANGELOG.md b/CHANGELOG.md index c541c6a..31391e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This change ## [Unreleased] +### Added (upstream PR #329 sync) +- Windows console window hiding: CLI process is spawned with explicit PIPE redirects ensuring the JVM sets `CREATE_NO_WINDOW` on Windows — no console window appears in GUI applications. Equivalent to upstream `windowsHide: true` (upstream PR #329). + ### Changed - Recommended default model for non-streaming examples is `claude-haiku-4.5` instead of `gpt-5.2` for faster response times diff --git a/src/github/copilot_sdk/process.clj b/src/github/copilot_sdk/process.clj index 220b76b..251d497 100644 --- a/src/github/copilot_sdk/process.clj +++ b/src/github/copilot_sdk/process.clj @@ -68,7 +68,14 @@ (when github-token (.put env-map "COPILOT_SDK_AUTH_TOKEN" github-token))) - ;; Configure stdio + ;; Configure stdio — use explicit PIPE redirects for all three streams. + ;; On Windows, the JVM's ProcessImpl sets CREATE_NO_WINDOW when none of the + ;; child's stdio handles are inherited from the parent console. By ensuring + ;; PIPE (not INHERIT) for stdin, stdout, and stderr, we guarantee no + ;; console window appears — equivalent to upstream windowsHide: true (PR #329). + (.redirectInput builder ProcessBuilder$Redirect/PIPE) + (.redirectOutput builder ProcessBuilder$Redirect/PIPE) + (.redirectError builder ProcessBuilder$Redirect/PIPE) (.redirectErrorStream builder false) (let [process (.start builder)