From 52ef0addd84a1737a4e1a4b07113a30d3d496fa1 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Tue, 4 Jul 2023 14:30:22 +0300 Subject: [PATCH] feat(shell): ensure launched processes are detached (#463) * feat(shell): ensure launched processes are detached ref: https://github.com/tauri-apps/tauri/issues/6849 * change file --- .changes/shell-detached.md | 5 +++++ Cargo.lock | 5 +++-- plugins/shell/src/scope.rs | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changes/shell-detached.md diff --git a/.changes/shell-detached.md b/.changes/shell-detached.md new file mode 100644 index 00000000..4d65f865 --- /dev/null +++ b/.changes/shell-detached.md @@ -0,0 +1,5 @@ +--- +"shell": patch +--- + +Ensure the launched process is detached so it can out-live your tauri app and does not shutdown with it. diff --git a/Cargo.lock b/Cargo.lock index 813f90dc..beff0708 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3309,11 +3309,12 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" +checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" dependencies = [ "is-wsl", + "libc", "pathdiff", ] diff --git a/plugins/shell/src/scope.rs b/plugins/shell/src/scope.rs index 67ebde6a..c184e922 100644 --- a/plugins/shell/src/scope.rs +++ b/plugins/shell/src/scope.rs @@ -264,8 +264,8 @@ impl Scope { // The prevention of argument escaping is handled by the usage of std::process::Command::arg by // the `open` dependency. This behavior should be re-confirmed during upgrades of `open`. match with.map(Program::name) { - Some(program) => ::open::with(path, program), - None => ::open::that(path), + Some(program) => ::open::with_detached(path, program), + None => ::open::that_detached(path), } .map_err(Into::into) }