From 31ab38d66b4e9909ec76c27ad8b26b5610970030 Mon Sep 17 00:00:00 2001 From: GuDaStudio Date: Sun, 9 Nov 2025 12:16:44 +0800 Subject: [PATCH] =?UTF-8?q?v0.4=EF=BC=9A=E6=B5=8B=E8=AF=95Windows=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/codexmcp/server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/codexmcp/server.py b/src/codexmcp/server.py index 3eb8bef..562e320 100644 --- a/src/codexmcp/server.py +++ b/src/codexmcp/server.py @@ -3,6 +3,7 @@ from __future__ import annotations import json +import os import queue import subprocess import threading @@ -32,8 +33,11 @@ def run_shell_command(cmd: list[str]) -> Generator[str, None, None]: Yields: Output lines from the command """ + # On Windows, wrap command with cmd.exe to execute .cmd batch files + popen_cmd = ["cmd", "/c", *cmd] if os.name == "nt" else cmd + process = subprocess.Popen( - cmd, + popen_cmd, shell=False, # Safer: no shell injection stdout=subprocess.PIPE, stderr=subprocess.STDOUT,