From bcd50ef67f243120a7f8601341953d8f45d636d2 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 19 Apr 2016 19:44:23 +0200 Subject: [PATCH] Change command verification Changed command verification because 'which' does sometimes produce an empty tac variable. --- zsh-peco-history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-peco-history.zsh b/zsh-peco-history.zsh index c120ff4..9f41fb6 100644 --- a/zsh-peco-history.zsh +++ b/zsh-peco-history.zsh @@ -8,8 +8,8 @@ if which peco &> /dev/null; then function peco_select_history() { local tac - (which gtac &> /dev/null && tac="gtac") || \ - (which tac &> /dev/null && tac="tac") || \ + ((($+commands[gtac])) && tac="gtac") || \ + (($+commands[tac])) && tac="tac" || \ tac="tail -r" BUFFER=$(fc -l -n 1 | eval $tac | \ peco --layout=bottom-up --query "$LBUFFER")