From 0608765f40a193d16651e1ac0c547bd2f9280bf9 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 29 Jul 2023 19:38:11 -0400 Subject: Update documentation regarding BAT_PAGER Ref #1467 --- manual/src/environment-variables.md | 10 ++++++---- src/cli.rs | 6 +++--- 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, #[arg( -- cgit v1.2.3