-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Upstream Change
Upstream PR github/copilot-sdk#329 adds automatic hiding of the CLI console window on Windows when spawning the CLI subprocess. This prevents a distracting terminal window appearing in GUI applications.
Node.js change (nodejs/src/client.ts):
this.cliProcess = spawn(command, spawnArgs, {
stdio: ...,
cwd: this.options.cwd,
env: envWithoutNodeDebug,
windowsHide: true, // <-- added
});Why Not Auto-Ported
The Clojure SDK uses Java's ProcessBuilder to spawn the CLI process (src/github/copilot_sdk/process.clj). Unlike Node.js's spawn which has a built-in windowsHide option, ProcessBuilder does not support hiding the Windows console window natively.
Options to port this to JVM:
-
JNA (Java Native Access) — Add a JNA dependency and call Windows
CreateProcessdirectly withCREATE_NO_WINDOW. This adds a native dependency but works cleanly. -
Reflection into
ProcessImpl— Fragile, not recommended. -
Accept as JVM limitation — Document that on Windows, a console window may briefly appear. The SDK primarily targets server-side use cases where this is less of a concern.
-
ProcessBuilder.inheritIO()+ redirects — Doesn't help with window visibility.
Recommendation
If the Clojure SDK targets Windows GUI applications, option 1 (JNA) is the cleanest approach. Otherwise, document the limitation.
The relevant Clojure file to modify is src/github/copilot_sdk/process.clj, specifically the spawn-cli function (lines 29-88).
Affected Upstream Files
nodejs/src/client.ts—windowsHide: truein both stdio and TCP spawn callspython/copilot/client.py—CREATE_NO_WINDOWflag on Windowsgo/client.go+go/process_windows.go— platform-specificSysProcAttr.HideWindow
Testing
After implementing, verify that on Windows, no console window appears when using the SDK from a GUI application (e.g., a JavaFX or Swing app).
Generated by Upstream Sync Agent