cli: ensure vscode server outlives CLI on windows (#210279)

This commit is contained in:
Connor Peet 2024-04-12 16:50:34 -07:00 committed by GitHub
parent a9174e5ac9
commit d30b358ac7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -606,7 +606,9 @@ impl<'a> ServerBuilder<'a> {
// Original issue: https://github.com/microsoft/vscode/issues/184058
// Partial fix: https://github.com/microsoft/vscode/pull/184621
#[cfg(target_os = "windows")]
let cmd = cmd.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW);
let cmd = cmd.creation_flags(
winapi::um::winbase::CREATE_NO_WINDOW | winapi::um::winbase::CREATE_NEW_PROCESS_GROUP | winapi::um::winbase::CREATE_BREAKAWAY_FROM_JOB,
);
let child = cmd
.stderr(std::process::Stdio::piped())