Re: [PATCH 2/3] setup_pager: set MORE=R
- From
Jeff King <peff@peff.net>
- Date
- Jan 21, 2014, 05:30 UTC
- Message-ID
- <20140121053026.GC5878@sigill.intra.peff.net>
- In-Reply-To
- <398F146D-72F1-44CD-B205-729665FD8765@gmail.com>
On Thu, Jan 16, 2014 at 11:26:50PM -0800, Kyle J. McKay wrote:
Show 13 quoted lines
> >--- 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");
> >+#endif
>
> How about adding a leading "-" to both the LESS and MORE settings?
> Since you're in there patching... :)I do not have any problem with that, but would very much prefer it as a separate patch, in case there are any fallouts.
Show 8 quoted lines
> 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"
Ugh. Having just read the LESS discussion, it makes me wonder if the
strchr(getenv("LESS"), 'R')check I add elsewhere in the series is sufficient. I suspect in practice it is good enough, but I would not be surprised if there is a way to fool it with a sufficiently complex LESS variable. Maybe we should just assume it is enough, and people with crazy LESS settings can set color.pager as appropriate?