]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/less/less.zprofile
Correctly test XDG_CACHE_HOME for writability for "stamp files"
[ax-zsh.git] / default_plugins / less / less.zprofile
index f651611379adcc3ed11d9a197bd13a3c3848dec4..aa3d17c9226b1853e90c086ffbbdf49c78054e75 100644 (file)
@@ -4,6 +4,7 @@
 # Make sure that "less(1)" is installed
 (( $+commands[less] )) || return
 
+export PAGER="$commands[less]"
 export LESS="-FmRX"
 
 # Support colors in less
@@ -15,4 +16,10 @@ export LESS_TERMCAP_so=$'\E[01;44;33m'
 export LESS_TERMCAP_ue=$'\E[0m'
 export LESS_TERMCAP_us=$'\E[01;32m'
 
-(( $+commands[lesspipe] )) && eval $(lesspipe)
+if (( $+commands[lesspipe] )); then
+       eval "$(lesspipe)"
+elif (( $+commands[lesspipe.sh] )); then
+       # Silence lesspipe(1), see <https://github.com/wofr06/lesspipe/issues/21>
+       export LESSQUIET=1
+       eval "$(lesspipe.sh 2>/dev/null)"
+fi