diff --git a/plugins/opener/src/open.rs b/plugins/opener/src/open.rs index bbd836e37..fe721f9c1 100644 --- a/plugins/opener/src/open.rs +++ b/plugins/opener/src/open.rs @@ -9,7 +9,14 @@ use std::{ffi::OsStr, path::Path}; pub(crate) fn open, S: AsRef>(path: P, with: Option) -> crate::Result<()> { match with { Some(program) => ::open::with_detached(path, program.as_ref()), - None => ::open::that_detached(path), + None => { + // ref https://github.com/tauri-apps/tauri/issues/10617 + #[cfg(target_os = "linux")] + return ::open::with_detached(&path, "/usr/bin/xdg-open") + .or_else(|_| ::open::that_detached(path)); + #[cfg(not(target_os = "linux"))] + ::open::that_detached(path) + } } .map_err(Into::into) }