From 90ffa7df2728e2a7de9295963f469e22a8f19b6c Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Fri, 24 Dec 2021 00:01:57 +0100 Subject: [PATCH] Lex exec even when using custom opener This fixes a few bugs I found related to custom opener. Instead of sending the entire exec as a single argument, this properly splits the command, trims trailing whitespaces, and lets the receiving opener iterate over terms. --- src/widgets/launcher.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/launcher.rs b/src/widgets/launcher.rs index 796f1a2..081f266 100644 --- a/src/widgets/launcher.rs +++ b/src/widgets/launcher.rs @@ -420,12 +420,13 @@ impl<'a> Widget for Launcher<'a> { &self.app_opener }; + let mut lexed = shlex::split(&exec).unwrap(); let lexed = if !prefix.is_empty() { let mut prefix = shlex::split(prefix).unwrap(); - prefix.push(exec); + prefix.append(&mut lexed); prefix } else { - shlex::split(&exec).unwrap() + lexed }; if !lexed.is_empty() { let _ =