diff --git a/crates/femm-app/src/main.rs b/crates/femm-app/src/main.rs index c96cefb..b1b0c33 100644 --- a/crates/femm-app/src/main.rs +++ b/crates/femm-app/src/main.rs @@ -2068,7 +2068,7 @@ fn compute_frame(base: FemmDoc, tracks: Vec, frame_idx: i64, d title: String::from("frame save .pbc failed"), body: format!("{pbc_path:?}\n\n{e}"), })?; - let tri_out = std::process::Command::new(&triangle) + let tri_out = quiet_command(&triangle) .args([ "-p", "-P", "-e", "-A", "-a", "-z", "-Q", "-I", &format!("-q{min_angle}"), @@ -2107,7 +2107,7 @@ fn compute_frame(base: FemmDoc, tracks: Vec, frame_idx: i64, d title: String::from("femm-mag-solve binary missing"), body: String::from("run `cargo xtask install`"), })?; - let solver_out = std::process::Command::new(&helper) + let solver_out = quiet_command(&helper) .arg(&stem_str) .output() .map_err(|e| ErrorReport { @@ -2449,7 +2449,7 @@ fn run_mesh(doc: &FemmDoc) -> Result { body: format!("{stem:?}"), })?; let min_angle = if doc.min_angle > 0.0 { doc.min_angle } else { MIN_ANGLE_DEG }; - let output = std::process::Command::new(&triangle) + let output = quiet_command(&triangle) .args([ "-p", "-P", "-e", "-A", "-a", "-z", "-Q", "-I", &format!("-q{min_angle}"), @@ -2489,7 +2489,7 @@ fn run_solve(stem: &Path) -> Result<(), ErrorReport> { body: String::from("run `cargo xtask install` (or set $FEMM_MAG_SOLVE to the femm-mag-solve executable)"), })?; - let output = std::process::Command::new(&helper) + let output = quiet_command(&helper) .arg(stem_str) .output() .map_err(|e| ErrorReport { @@ -2547,6 +2547,17 @@ fn unix_signal(status: &std::process::ExitStatus) -> Option { #[cfg(not(unix))] fn unix_signal(_status: &std::process::ExitStatus) -> Option { None } +fn quiet_command(program: &std::path::Path) -> std::process::Command { + let mut cmd = std::process::Command::new(program); + #[cfg(windows)] + { + use std::os::windows::process::CommandExt; + const CREATE_NO_WINDOW: u32 = 0x0800_0000; + cmd.creation_flags(CREATE_NO_WINDOW); + } + cmd +} + /// resolves the femm-mag-solve helper path from the bundled app, the dev target dir, or $FEMM_MAG_SOLVE. fn locate_mag_solver() -> Option { let exe_name = format!("femm-mag-solve{}", std::env::consts::EXE_SUFFIX);