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")