Issue
When spawn Claude subprocess via SDK on Windows, a terminal window remains visible. Need to hide the terminal for a cleaner UX.
Workaround
before
|
self._process = await anyio.open_process( |
|
cmd, |
|
stdin=PIPE, |
|
stdout=PIPE, |
|
stderr=stderr_dest, |
|
cwd=self._cwd, |
|
env=process_env, |
|
user=self._options.user, |
|
) |
after
if sys.platform == "win32":
import subprocess
creationflags = subprocess.CREATE_NO_WINDOW
self._process = await anyio.open_process(
cmd,
stdin=PIPE,
stdout=PIPE,
stderr=stderr_dest,
cwd=self._cwd,
env=process_env,
user=self._options.user,
creationflags=creationflags if creationflags else 0
)
Issue
When spawn Claude subprocess via SDK on Windows, a terminal window remains visible. Need to hide the terminal for a cleaner UX.
Workaround
before
claude-agent-sdk-python/src/claude_agent_sdk/_internal/transport/subprocess_cli.py
Lines 403 to 411 in 7866e5f
after