fix: set xdg_open stdout and stderr to null to prevent broken pipes
This commit is contained in:
parent
b51b8aabb5
commit
643e39bd1b
1 changed files with 6 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ pub mod terminal;
|
||||||
pub mod web;
|
pub mod web;
|
||||||
|
|
||||||
use pop_launcher::PluginResponse;
|
use pop_launcher::PluginResponse;
|
||||||
use std::{borrow::Cow, ffi::OsStr, future::Future, path::Path};
|
use std::{borrow::Cow, ffi::OsStr, future::Future, path::Path, process::Stdio};
|
||||||
use tokio::io::{AsyncWrite, AsyncWriteExt};
|
use tokio::io::{AsyncWrite, AsyncWriteExt};
|
||||||
|
|
||||||
pub async fn send<W: AsyncWrite + Unpin>(tx: &mut W, response: PluginResponse) {
|
pub async fn send<W: AsyncWrite + Unpin>(tx: &mut W, response: PluginResponse) {
|
||||||
|
|
@ -47,5 +47,9 @@ pub fn mime_from_path(path: &Path) -> Cow<'static, str> {
|
||||||
|
|
||||||
/// Launches a file with its default appplication via `xdg-open`.
|
/// Launches a file with its default appplication via `xdg-open`.
|
||||||
pub fn xdg_open<S: AsRef<OsStr>>(file: S) {
|
pub fn xdg_open<S: AsRef<OsStr>>(file: S) {
|
||||||
let _ = tokio::process::Command::new("xdg-open").arg(file).spawn();
|
let _ = tokio::process::Command::new("xdg-open")
|
||||||
|
.arg(file)
|
||||||
|
.stdout(Stdio::null())
|
||||||
|
.stderr(Stdio::null())
|
||||||
|
.spawn();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue