Compare commits

...

6 Commits

Author SHA1 Message Date
fabianlars 0fd529ae22 revert 2024-12-02 22:31:52 +01:00
fabianlars f71be86d47 temp 2024-12-02 22:28:41 +01:00
FabianLars 7d9dfaeb9e lint 2024-11-26 15:40:14 +01:00
FabianLars 2c00f7ddad shell 2024-11-26 15:04:53 +01:00
FabianLars 0f310e75ed fix 2024-11-26 14:57:41 +01:00
FabianLars bf3e8a0b8a fix(opener): Try /usr/bin/xdg-open first 2024-11-26 14:47:35 +01:00
3 changed files with 19 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
shell: patch
---
shell.open will now try to execute `/usr/bin/xdg-open` before using `xdg-open` from `PATH`.
+7
View File
@@ -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)
+7
View File
@@ -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)