Commit b0268d7
committed
fix(#863): use pythonw.exe + drop DETACHED_PROCESS to actually suppress Windows console
Real-world Claude Desktop test on Windows showed the previous fix
was a no-op: a cmd window still popped and closing it killed the
sidecar. Root cause in Python's subprocess docs:
"CREATE_NO_WINDOW... is ignored if you specify CREATE_NEW_CONSOLE
or DETACHED_PROCESS."
DETACHED_PROCESS on a CUI binary (python.exe) auto-allocates a fresh
visible console — and that's the cmd window the user saw. The closed-
window killing the server is because the auto-allocated console's
process group sends CTRL_CLOSE_EVENT to the child when X is clicked.
Drop DETACHED_PROCESS entirely; prefer pythonw.exe (GUI subsystem,
never allocates a console) over python.exe; keep CREATE_NEW_PROCESS_GROUP
(blocks CTRL_C / CTRL_CLOSE propagation from any console that might
attach during the python.exe fallback path) and CREATE_NO_WINDOW
(belt-and-suspenders for the fallback, harmless when pythonw is in
use). pythonw.exe ships alongside python.exe in every standard CPython
install including uv-managed ones.1 parent 75adaae commit b0268d7
1 file changed
Lines changed: 27 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
329 | 345 | | |
330 | | - | |
331 | | - | |
| 346 | + | |
332 | 347 | | |
333 | 348 | | |
| 349 | + | |
334 | 350 | | |
335 | 351 | | |
336 | 352 | | |
| |||
339 | 355 | | |
340 | 356 | | |
341 | 357 | | |
342 | | - | |
343 | | - | |
| 358 | + | |
344 | 359 | | |
345 | 360 | | |
346 | 361 | | |
| |||
0 commit comments