summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBernard Grymonpon <bernard@grymonpon.be>2023-11-27 11:07:51 +0100
committerGitHub <noreply@github.com>2023-11-27 11:07:51 +0100
commit7e3fdf33ec53821e574b8d6df43bec7264c507ee (patch)
tree74ce828f9d44ee05e179548afacb61e6b22a442c /lib
parente11d81303753b0fefbc50ce10ec4612c7ff33e84 (diff)
downloadzsh-7e3fdf33ec53821e574b8d6df43bec7264c507ee.tar.gz
zsh-7e3fdf33ec53821e574b8d6df43bec7264c507ee.tar.bz2
zsh-7e3fdf33ec53821e574b8d6df43bec7264c507ee.zip
fix(misc): only set PAGER if `less` or `more` are available (#12060)
Diffstat (limited to 'lib')
-rw-r--r--lib/misc.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/misc.zsh b/lib/misc.zsh
index 132f33551..ff2017713 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -19,8 +19,13 @@ setopt multios # enable redirect to multiple streams: echo >file1 >
setopt long_list_jobs # show long list format job notifications
setopt interactivecomments # recognize comments
-env_default 'PAGER' 'less'
-env_default 'LESS' '-R'
+# define pager dependant on what is available (less or more)
+if (( ${+commands[less]} )); then
+ env_default 'PAGER' 'less'
+ env_default 'LESS' '-R'
+elif (( ${+commands[more]} )); then
+ env_default 'PAGER' 'more'
+fi
## super user alias
alias _='sudo '