fix: hide console window for stdio extensions on Windows (#4085)
This commit is contained in:
@@ -77,6 +77,9 @@ impl ResourceItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
const CREATE_NO_WINDOW_FLAG: u32 = 0x08000000;
|
||||||
|
|
||||||
/// Sanitizes a string by replacing invalid characters with underscores.
|
/// Sanitizes a string by replacing invalid characters with underscores.
|
||||||
/// Valid characters match [a-zA-Z0-9_-]
|
/// Valid characters match [a-zA-Z0-9_-]
|
||||||
fn normalize(input: String) -> String {
|
fn normalize(input: String) -> String {
|
||||||
@@ -111,6 +114,8 @@ async fn child_process_client(
|
|||||||
) -> ExtensionResult<McpClient> {
|
) -> ExtensionResult<McpClient> {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
command.process_group(0);
|
command.process_group(0);
|
||||||
|
#[cfg(windows)]
|
||||||
|
command.creation_flags(CREATE_NO_WINDOW_FLAG);
|
||||||
let (transport, mut stderr) = TokioChildProcess::builder(command)
|
let (transport, mut stderr) = TokioChildProcess::builder(command)
|
||||||
.stderr(Stdio::piped())
|
.stderr(Stdio::piped())
|
||||||
.spawn()?;
|
.spawn()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user