Re: [PATCH 2/3] setup_pager: set MORE=R
- From
Kyle J. McKay <mackyle@gmail.com>
- Date
- Jan 17, 2014, 07:26 UTC
- Message-ID
- <398F146D-72F1-44CD-B205-729665FD8765@gmail.com>
- In-Reply-To
- <20140117042153.GB23443@sigill.intra.peff.net>
On Jan 16, 2014, at 20:21, Jeff King wrote:
> When we run the pager, we always set "LESS=R" to tell the > pager to pass through ANSI colors. On modern versions of > FreeBSD, the system "more" can do the same trick.
[snip]
Show 12 quoted lines
> diff --git a/pager.c b/pager.c
> index 90d237e..2303164 100644
> --- a/pager.c
> +++ b/pager.c
> @@ -87,6 +87,10 @@ void setup_pager(void)
> argv_array_push(&env, "LESS=FRSX");
> if (!getenv("LV"))
> argv_array_push(&env, "LV=-c");
> +#ifdef PAGER_MORE_UNDERSTANDS_R
> + if (!getenv("MORE"))
> + argv_array_push(&env, "MORE=R");
> +#endifHow about adding a leading "-" to both the LESS and MORE settings? Since you're in there patching... :)
The man page for more states:
"Options are also taken from the environment variable MORE (make sure to precede them with a dash (``-'')) but command line options will override them."
And while the less man page does not have that wording, it does show this:
LESS="-options"; export LESS
and this:
LESS="-Dn9.1$-Ds4.1"
So it looks like both LESS and MORE prefer to have their options start with a '-' more or less.