diff --git a/crates/util/src/command.rs b/crates/util/src/command.rs index dde1603dfe29df0315caf6d99f1d9e1d03b131c1..40f1ec323f6dd799bdda07da2540741d46c99cea 100644 --- a/crates/util/src/command.rs +++ b/crates/util/src/command.rs @@ -58,7 +58,7 @@ pub fn new_smol_command(program: impl AsRef) -> smol::process::Command { } #[cfg(target_os = "macos")] -fn reset_exception_ports() { +pub fn reset_exception_ports() { use mach2::exception_types::{ EXC_MASK_ALL, EXCEPTION_DEFAULT, exception_behavior_t, exception_mask_t, }; diff --git a/crates/util/src/util.rs b/crates/util/src/util.rs index 169da43b5282456ab4b056149bcaf3dbda5b4534..4ea35901963523180eb6df7534565fd77ebb2585 100644 --- a/crates/util/src/util.rs +++ b/crates/util/src/util.rs @@ -390,6 +390,8 @@ pub fn set_pre_exec_to_start_new_session( use std::os::unix::process::CommandExt; command.pre_exec(|| { libc::setsid(); + #[cfg(target_os = "macos")] + crate::command::reset_exception_ports(); Ok(()) }); };