diff --git a/runcoms/zprofile b/runcoms/zprofile index 7118770c..aadca227 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -57,8 +57,9 @@ path=( export LESS='-F -g -i -M -R -S -w -X -z-4' # Set the Less input preprocessor. -if (( $+commands[lesspipe.sh] )); then - export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' +# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. +if (( $#commands[(i)lesspipe(|.sh)] )); then + export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" fi #