Skip to content

Commit 643e39b

Browse files
canadaduanemmstick
authored andcommitted
fix: set xdg_open stdout and stderr to null to prevent broken pipes
1 parent b51b8aa commit 643e39b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugins/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub mod terminal;
1313
pub mod web;
1414

1515
use pop_launcher::PluginResponse;
16-
use std::{borrow::Cow, ffi::OsStr, future::Future, path::Path};
16+
use std::{borrow::Cow, ffi::OsStr, future::Future, path::Path, process::Stdio};
1717
use tokio::io::{AsyncWrite, AsyncWriteExt};
1818

1919
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> {
4747

4848
/// Launches a file with its default appplication via `xdg-open`.
4949
pub fn xdg_open<S: AsRef<OsStr>>(file: S) {
50-
let _ = tokio::process::Command::new("xdg-open").arg(file).spawn();
50+
let _ = tokio::process::Command::new("xdg-open")
51+
.arg(file)
52+
.stdout(Stdio::null())
53+
.stderr(Stdio::null())
54+
.spawn();
5155
}

0 commit comments

Comments
 (0)