From 643e39bd1b15ddf09a7a44b05abc1ce5a998f23b Mon Sep 17 00:00:00 2001 From: Duane Johnson Date: Wed, 11 Jan 2023 14:31:58 -0700 Subject: [PATCH] fix: set xdg_open stdout and stderr to null to prevent broken pipes --- plugins/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/src/lib.rs b/plugins/src/lib.rs index a32d515..add02f7 100644 --- a/plugins/src/lib.rs +++ b/plugins/src/lib.rs @@ -13,7 +13,7 @@ pub mod terminal; pub mod web; 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}; pub async fn send(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`. pub fn xdg_open>(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(); }