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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user