From 2a714a45f06edaa3fa8eaa196ce0a8bebaae70ce Mon Sep 17 00:00:00 2001 From: Lucas Ritzdorf <42657792+LRitzdorf@users.noreply.github.com> Date: Wed, 4 Sep 2024 20:41:37 -0600 Subject: [PATCH] execute copy command via system shell ...specifically, `sh`. This allows for commands with arguments, such as `wl-copy -t image/png`, or even more advanced shell features. This technically also allows for arbitrary command execution, but the user already has execution privileges anyway if they're providing a copy command. --- src/sketch_board.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sketch_board.rs b/src/sketch_board.rs index d68996a..9ab8e9c 100644 --- a/src/sketch_board.rs +++ b/src/sketch_board.rs @@ -232,7 +232,9 @@ impl SketchBoard { texture: &impl IsA, command: &str, ) -> anyhow::Result<()> { - let mut child = Command::new(command) + let mut child = Command::new("sh") + .arg("-c") + .arg(command) .stdin(Stdio::piped()) .stdout(Stdio::null()) .spawn()?;