]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/env: Display error message if lesspipe failed.
authorSimon Ruderich <simon@ruderich.org>
Tue, 6 Sep 2011 19:26:21 +0000 (21:26 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 6 Sep 2011 19:26:21 +0000 (21:26 +0200)
Some OS (including Gentoo) install /usr/bin/lesspipe but with a
different behavior than the Debian version.

zsh/env

diff --git a/zsh/env b/zsh/env
index 6c02f4675bfc44400ae823d0676abdb024efa72d..373a8498135b02f9d03fa4f9ad839b75e728f693 100644 (file)
--- a/zsh/env
+++ b/zsh/env
@@ -28,7 +28,9 @@ export LESS_TERMCAP_se=$'\e[0m'
 # Setup lesspipe to view multiple file-types (like .gz, .zip, etc.) with less.
 # Useful in combination with the "p" alias. Taken from Debian's default bash
 # files. Thanks.
-[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)"
+if [[ -x /usr/bin/lesspipe ]]; then
+    eval "$(SHELL=/bin/sh lesspipe)" || echo "Broken lesspipe!" >&2
+fi
 
 
 source_config ~/.zsh/env.local