Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/shell-xdgopen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
shell: patch
---

shell.open will now try to execute `/usr/bin/xdg-open` before using `xdg-open` from `PATH`.
7 changes: 7 additions & 0 deletions plugins/opener/src/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ use std::{ffi::OsStr, path::Path};
pub(crate) fn open<P: AsRef<OsStr>, S: AsRef<str>>(path: P, with: Option<S>) -> crate::Result<()> {
match with {
Some(program) => ::open::with_detached(path, program.as_ref()),
#[cfg(target_os = "linux")]
None => {
// ref https://github.com/tauri-apps/tauri/issues/10617
::open::with_detached(&path, "/usr/bin/xdg-open")
.or_else(|_| ::open::that_detached(path))
}
#[cfg(not(target_os = "linux"))]
None => ::open::that_detached(path),
}
.map_err(Into::into)
Expand Down
7 changes: 7 additions & 0 deletions plugins/shell/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ impl OpenScope {
// the `open` dependency. This behavior should be re-confirmed during upgrades of `open`.
match with.map(Program::name) {
Some(program) => ::open::with_detached(path, program),
#[cfg(target_os = "linux")]
None => {
// ref https://github.com/tauri-apps/tauri/issues/10617
::open::with_detached(path, "/usr/bin/xdg-open")
.or_else(|_| ::open::that_detached(path))
}
#[cfg(not(target_os = "linux"))]
None => ::open::that_detached(path),
}
.map_err(Into::into)
Expand Down
Loading