Skip to content

Commit 72b68aa

Browse files
Bonus: Fix LaunchBehavior::Quit crashing game on Unix
1 parent 3a7ad02 commit 72b68aa

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src-tauri/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use util::AlertVariant;
1818
use std::{
1919
collections::{HashMap, HashSet},
2020
env,
21+
process::Stdio,
2122
sync::{mpsc, Arc, LazyLock, OnceLock},
2223
vec,
2324
};
@@ -668,6 +669,12 @@ async fn prep_launch(
668669
}
669670
}
670671

672+
// Detach stdio so the child doesn't crash from broken pipes
673+
// when the launcher exits (e.g. LaunchBehavior::Quit)
674+
cmd.stdin(Stdio::null());
675+
cmd.stdout(Stdio::null());
676+
cmd.stderr(Stdio::null());
677+
671678
util::log_command(&cmd);
672679
state.launch_cmd = Some(cmd);
673680
Ok(timeout_sec)

0 commit comments

Comments
 (0)