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 _ =
--
2.34.1
wldash/patches/.build.yml: SUCCESS in 2m22s
[Lex exec even when using custom opener][0] from [Maxim Baz][1]
[0]: https://lists.sr.ht/~kennylevinsen/public-inbox/patches/27626
[1]: mailto:git@maximbaz.com
✓ #655803 SUCCESS wldash/patches/.build.yml https://builds.sr.ht/~kennylevinsen/job/655803
Hmm, this does appear to cause somewhat annoying behavior.
Specifically, it breaks use of `swaymsg exec` as a custom launcher,
which for sway is more or less the suggested custom launcher.
I am considering reverting this patch. What was the use-case that
required it?