From 70b9b8d7682062dada0477d1d79b65b273230b13 Mon Sep 17 00:00:00 2001 From: MahouShoujoMivutilde <14999778+MahouShoujoMivutilde@users.noreply.github.com> Date: Tue, 13 Oct 2020 23:48:05 +0300 Subject: [PATCH] fzfmenu - when there is no arguments - don't pass anything to fzf (instead of calling fzf '') --- Examples.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Examples.md b/Examples.md index adb5300..c7caceb 100644 --- a/Examples.md +++ b/Examples.md @@ -1468,11 +1468,12 @@ mkfifo $output chmod 600 $input $output # it's better to use st here (starts a lot faster than pretty much everything else) -# the ugly printf thing is here to make args with quotes work. +# the ugly printf | sed thing is here to make args with quotes work. # (e.g. --preview='echo {1}') # sadly we can't use "$@" here directly because we are inside sh -c "..." call # already -st -c fzfmenu -n fzfmenu -e sh -c "cat $input | fzf $(printf -- " '%s'" "$@") | tee $output" & disown + +st -c fzfmenu -n fzfmenu -e sh -c "cat $input | fzf $(printf -- " '%s'" "$@" | sed "s/^ ''$//") | tee $output" & disown # handle ctrl+c outside child terminal window trap "kill $! 2>/dev/null; rm -f $input $output" EXIT