diff --git a/src-tauri/src/cmds.rs b/src-tauri/src/cmds.rs index 81a0160b9cf5c508f4fa5ccff2b4f802c3a11ed6..eeaabd5c6cc981678ed3fc8d0bdde01d06d0e29d 100644 --- a/src-tauri/src/cmds.rs +++ b/src-tauri/src/cmds.rs @@ -174,7 +174,7 @@ pub fn view_profile(index: usize, profiles_state: State<'_, ProfilesState>) -> R // use vscode first if let Ok(code) = which::which("code") { - return match Command::new(code).arg(path).status() { + return match Command::new(code).arg(path).spawn() { Ok(_) => Ok(()), Err(_) => Err("failed to open file by VScode".into()), }; @@ -182,7 +182,7 @@ pub fn view_profile(index: usize, profiles_state: State<'_, ProfilesState>) -> R // use `open` command if let Ok(open) = which::which("open") { - return match Command::new(open).arg(path).status() { + return match Command::new(open).arg(path).spawn() { Ok(_) => Ok(()), Err(_) => Err("failed to open file by `open`".into()), };