aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xsrc/password-store.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 6233a00..fbeef0e 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -18,11 +18,15 @@ CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}"
export GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git"
export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}"
-export LESS="${PASSWORD_STORE_LESS:-FRSXMK}"
-PAGER="${PAGER:-pager}"
-which "$PAGER" &>/dev/null || PAGER="less"
-which "$PAGER" &>/dev/null || PAGER="more"
-which "$PAGER" &>/dev/null || PAGER="cat"
+if [[ -t 1 ]]; then
+ export LESS="${PASSWORD_STORE_LESS:-FRSXMK}"
+ PAGER="${PAGER:-pager}"
+ which "$PAGER" &>/dev/null || PAGER="less"
+ which "$PAGER" &>/dev/null || PAGER="more"
+ which "$PAGER" &>/dev/null || PAGER="cat"
+else
+ PAGER="cat"
+fi
#
# BEGIN helper functions