summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2023-07-29 19:38:11 -0400
committerDan Davison <dandavison7@gmail.com>2023-07-29 19:38:11 -0400
commit0608765f40a193d16651e1ac0c547bd2f9280bf9 (patch)
treed671fdeac9fec6509c40e52e6c652306b0c15f8f
parent3c55764215feb54b09bc11ff445acf5ef23afe00 (diff)
Update documentation regarding BAT_PAGER
Ref #1467
-rw-r--r--manual/src/environment-variables.md10
-rw-r--r--src/cli.rs6
2 files changed, 9 insertions, 7 deletions
diff --git a/manual/src/environment-variables.md b/manual/src/environment-variables.md
index e9491e02..599b8bfb 100644
--- a/manual/src/environment-variables.md
+++ b/manual/src/environment-variables.md
@@ -19,16 +19,18 @@ Therefore:
The exact command that `delta` uses to start its pager is taken from one of the following environment variables (in this order):
- `DELTA_PAGER`
+- `BAT_PAGER`
- `PAGER`
+Delta does not use `bat` when it is running, and delta users do not need to
+install bat. (Delta does use the `bat` Rust library for its syntax highlighting
+themes and language definitions, and for launching the pager, which is why the
+`BAT_PAGER` environment variable is honored).
+
If none of these is set, delta uses `less -R`, and you should always include `-R` if you are setting these environment variables yourself.
In addition to those `*PAGER` environment variables, the behavior of `less` is also affected by the `LESS` environment variable (see `man less` or [online documentation](https://linux.die.net/man/1/less)). This env var can contain command line options and/or interactive less-commands (prefixed by a leading `+` sign; these are executed every time right after less is launched).
-In addition to `DELTA_PAGER`, and `PAGER`, delta currently also consults `$BAT_PAGER` (with priority between the two).
-However, this is deprecated: please use `DELTA_PAGER` instead.
-No other [`bat`](https://github.com/sharkdp/bat) environment variables are used by delta, and delta does not use `bat` when it is running (it does use some code from the excellent `bat` project, but users don't need to be aware of this).
-
## Delta-specific environment variables
To temporarily activate and inactivate delta features, you can use `DELTA_FEATURES`, e.g.
diff --git a/src/cli.rs b/src/cli.rs
index e1e47503..817ab056 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -838,9 +838,9 @@ pub struct Opt {
#[arg(long = "pager", value_name = "CMD")]
/// Which pager to use.
///
- /// The default pager is `less`. You can also change pager by setting the environment variables
- /// DELTA_PAGER, BAT_PAGER, or PAGER (and that is their order of priority). This option
- /// overrides all environment variables above.
+ /// The default pager is `less`. You can also change pager by setting the
+ /// environment variable DELTA_PAGER, or PAGER. This option overrides these
+ /// environment variables.
pub pager: Option<String>,
#[arg(