summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bat_utils/output.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bat_utils/output.rs b/src/bat_utils/output.rs
index eef00cd5..79b33bd4 100644
--- a/src/bat_utils/output.rs
+++ b/src/bat_utils/output.rs
@@ -118,6 +118,16 @@ impl OutputType {
p.env("LESSCHARSET", "UTF-8");
p
} else {
+ if pager_path.file_stem() == Some(&OsString::from("delta")) {
+ eprintln!(
+ "\
+It looks like you have set delta as the value of $PAGER. \
+This would result in a non-terminating recursion. \
+delta is not an appropriate value for $PAGER \
+(but it is an appropriate value for $GIT_PAGER)."
+ );
+ std::process::exit(1);
+ }
let mut p = Command::new(&pager_path);
p.args(args);
p