1
0
mirror of https://github.com/GuDaStudio/codexmcp.git synced 2026-02-05 02:00:24 +08:00

v0.4:测试Windows兼容性

This commit is contained in:
GuDaStudio
2025-11-09 12:16:44 +08:00
parent 735082c00b
commit 31ab38d66b

View File

@@ -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,