Use `open` instead of `xdg-open` in macos

TODO: make this configurable instead.
pull/144/head
Manos Pitsidianakis 2022-05-05 18:27:49 +03:00
parent 8563bccd1b
commit 4fdc90b31e
2 changed files with 40 additions and 4 deletions

View File

@ -2334,7 +2334,16 @@ impl Component for MailView {
)
.as_ref()
.map(|s| s.as_str())
.unwrap_or("xdg-open");
.unwrap_or(
#[cfg(target_os = "macos")]
{
"open"
},
#[cfg(not(target_os = "macos"))]
{
"xdg-open"
},
);
match Command::new(url_launcher)
.arg(url)
.stdin(Stdio::piped())
@ -2622,7 +2631,16 @@ impl Component for MailView {
)
.as_ref()
.map(|s| s.as_str())
.unwrap_or("xdg-open");
.unwrap_or(
#[cfg(target_os = "macos")]
{
"open"
},
#[cfg(not(target_os = "macos"))]
{
"xdg-open"
},
);
match Command::new(url_launcher)
.arg(String::from_utf8_lossy(url).into_owned())
.stdin(Stdio::piped())
@ -2656,7 +2674,16 @@ impl Component for MailView {
)
.as_ref()
.map(|s| s.as_str())
.unwrap_or("xdg-open");
.unwrap_or(
#[cfg(target_os = "macos")]
{
"open"
},
#[cfg(not(target_os = "macos"))]
{
"xdg-open"
},
);
match Command::new(url_launcher)
.arg(actions.archive.unwrap())
.stdin(Stdio::piped())

View File

@ -498,7 +498,16 @@ impl Component for EnvelopeView {
.url_launcher
.as_ref()
.map(|s| s.as_str())
.unwrap_or("xdg-open");
.unwrap_or(
#[cfg(target_os = "macos")]
{
"open"
},
#[cfg(not(target_os = "macos"))]
{
"xdg-open"
},
);
match Command::new(url_launcher)
.arg(url)
.stdin(Stdio::piped())