l fzfmenu: show query if no match
This commit is contained in:
parent
1ed6cb7168
commit
843a537bd7
@ -32,14 +32,24 @@ pkgs.writeDashBin "fzfmenu" ''
|
|||||||
done
|
done
|
||||||
INPUT=$(${pkgs.coreutils}/bin/cat)
|
INPUT=$(${pkgs.coreutils}/bin/cat)
|
||||||
OUTPUT="$(${pkgs.coreutils}/bin/mktemp)"
|
OUTPUT="$(${pkgs.coreutils}/bin/mktemp)"
|
||||||
${pkgs.rxvt_unicode}/bin/urxvt \
|
if [ -z ''${TERM+x} ]; then #check if we can print fzf in the shell
|
||||||
|
${pkgs.rxvt_unicode}/bin/urxvtc \
|
||||||
-name fzfmenu -title fzfmenu \
|
-name fzfmenu -title fzfmenu \
|
||||||
-e ${pkgs.dash}/bin/dash -c \
|
-e ${pkgs.dash}/bin/dash -c \
|
||||||
"echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
|
"echo \"$INPUT\" | ${pkgs.fzf}/bin/fzf \
|
||||||
--history=/dev/null \
|
--history=/dev/null \
|
||||||
--print-query \
|
--print-query \
|
||||||
--prompt=\"$PROMPT\" \
|
--prompt=\"$PROMPT\" \
|
||||||
|
--reverse \
|
||||||
> \"$OUTPUT\"" 2>/dev/null
|
> \"$OUTPUT\"" 2>/dev/null
|
||||||
|
else
|
||||||
|
echo "$INPUT" | ${pkgs.fzf}/bin/fzf \
|
||||||
|
--history=/dev/null \
|
||||||
|
--print-query \
|
||||||
|
--prompt="$PROMPT" \
|
||||||
|
--reverse \
|
||||||
|
> "$OUTPUT"
|
||||||
|
fi
|
||||||
${pkgs.coreutils}/bin/tail -1 "$OUTPUT"
|
${pkgs.coreutils}/bin/tail -1 "$OUTPUT"
|
||||||
${pkgs.coreutils}/bin/rm "$OUTPUT"
|
${pkgs.coreutils}/bin/rm "$OUTPUT"
|
||||||
''
|
''
|
||||||
|
Loading…
Reference in New Issue
Block a user