mirror of
https://github.com/openai/codex.git
synced 2026-05-20 03:05:02 +00:00
Silence Windows taskkill during MCP cleanup
This commit is contained in:
@@ -15,6 +15,8 @@ use std::collections::HashMap;
|
||||
use std::ffi::OsString;
|
||||
use std::future::Future;
|
||||
use std::io;
|
||||
#[cfg(windows)]
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Stdio;
|
||||
use std::sync::Arc;
|
||||
@@ -197,6 +199,9 @@ impl StdioServerLauncher for LocalStdioServerLauncher {
|
||||
#[cfg(unix)]
|
||||
const PROCESS_GROUP_TERM_GRACE_PERIOD: Duration = Duration::from_secs(2);
|
||||
|
||||
#[cfg(windows)]
|
||||
const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||
|
||||
#[cfg(unix)]
|
||||
struct LocalProcessTerminator {
|
||||
process_group_id: u32,
|
||||
@@ -341,6 +346,10 @@ impl LocalProcessTerminator {
|
||||
.arg(self.pid.to_string())
|
||||
.arg("/T")
|
||||
.arg("/F")
|
||||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::null())
|
||||
.creation_flags(CREATE_NO_WINDOW)
|
||||
.status();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user