fix: 退出时直接调用 taskkill.exe,避免关机阶段 cmd.exe 初始化失败导致 0xc0000142

This commit is contained in:
晴天
2026-05-13 16:00:07 +08:00
parent c11c2e5580
commit 33e0487574

View File

@@ -297,8 +297,8 @@ pub fn run() {
// 退出时关闭 Gateway 终端窗口
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
let _ = std::process::Command::new("cmd")
.args(["/c", "taskkill", "/fi", "WINDOWTITLE eq OpenClaw Gateway"])
let _ = std::process::Command::new("taskkill")
.args(["/fi", "WINDOWTITLE eq OpenClaw Gateway"])
.creation_flags(CREATE_NO_WINDOW)
.output();
}