git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: pager: consider revisiting automatic LESS=FRX with custom core.pager

From
Todd Zullinger <tmz@pobox.com>
Date
Sep 19, 2026, 16:37 UTC
Message-ID
<20260919163725.TExDduTp@teonanacatl.net>
In-Reply-To
<aq6utXAQA-rRoKSm@fruit.crustytoothpaste.net>
brian m. carlson wrote:
Show 27 quoted lines
> I agree that this can cause unusual behaviour in the case you've
> described, but that's more of the case because it's actually unusual to
> have commands that take arguments through the environment in this way.
> That's no longer really considered a good design; normally we use a
> config file instead these days.
> 
> I'll note that it is configurable both through the environment and
> through configuration, using one of the following:
> 
>     GIT_PAGER='LESS="" delta'
> 
> or:
> 
>     git config core.pager 'LESS="" delta'
> 
> or, if you prefer to be still more conservative:
> 
>     GIT_PAGER='env -i PATH="$PATH" delta'
> 
> which unsets all environment variables but the path for your pager.
> 
>> So this is not primarily a request for a workaround; rather, I wanted
>> to raise the broader behavior because the interaction with pager
>> wrappers is quite surprising and difficult to diagnose.
> 
> I think at this point, we're unlikely to change the behaviour and it
> would be a notable and unwelcome change to do so.

All good points. I wonder if it would help to add a couple of sentences to the core.pager documentation mentioning the method of setting `LESS=""` as another way to override the options? Something like:

  diff --git i/Documentation/config/core.adoc w/Documentation/config/core.adoc
  index 340329edc3..45e1fda2a2 100644
  --- i/Documentation/config/core.adoc
  +++ w/Documentation/config/core.adoc
  @@ -614,9 +614,15 @@ command to `LESS=FRX less -S`. The environment does not set the
   long lines. Similarly, setting `core.pager` to `less -+F` will
   deactivate the `F` option specified by the environment from the
   command-line, deactivating the "quit if one screen" behavior of
  -`less`.  One can specifically activate some flags for particular
  -commands: for example, setting `pager.blame` to `less -S` enables
  -line truncation only for `git blame`.
  +`less`. Another way to deactivate an option is setting `core.pager`
  +to `LESS="RX" less` or `LESS="" less` to override all options. The
  +second form is useful if the `core.pager` command eventually runs
  +`less` or a command which respects the `LESS` environment variable
  +but lacks command line options to override `LESS` options.
  ++
  +One can specifically activate some flags for particular commands: for
  +example, setting `pager.blame` to `less -S` enables line truncation
  +only for `git blame`.
   +
   Likewise, when the `LV` environment variable is unset, Git sets it
   to `-c`.  You can override this setting by exporting `LV` with

I don't know if that adds more value than the cost of increasing the verbiage of an already long document.

-- 
Todd
Previous: brian m. carlsonNext: Todd Zullinger
Message 3 of 7 in “pager: consider revisiting automatic LESS=FRX with custom core.pager”
  1. Francisco BoniSep 19, 2026
  2. brian m. carlsonSep 19, 2026
  3. Todd ZullingerSep 19, 2026
  4. doc: add more examples of overriding LESS in core.pagerTodd Zullinger, Oct 2, 2026
  5. brian m. carlsonOct 5, 2026
  6. Junio C HamanoOct 6, 2026
  7. Francisco BoniSep 19, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.