You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your report. Actually that's exactly the use case for FORGIT_ENTER_PAGER.
I'm not sure we should respect the user's LESS env by default, as this could break the intended forgit user experience.
We should document the variable, though. @wfxr@sandr01d@cjappl WDYT?
I agree with you @carlfriedrich, overriding $LESS by default to prevent breakage makes sense to me and of course $FORGIT_ENTER_PAGER should be documented.
I looked further into the history, and the LESS override was originally introduced in b27df40 specifically to prevent -F from making the Enter pager exit immediately for short output. So changing the default to less -R would not be behavior-neutral: -R is sufficient for ANSI color pass-through, but inherited options such as -F, -E, -X, and -S can still change the full-screen behavior.
Git preserves an existing LESS, but it also uses command-line options such as less -+F for selective overrides. If we want to follow that model, we should first define which Enter-pager behavior forgit needs to guarantee and override those options explicitly. Otherwise, resetting LESS is intentional and should be documented.
Either way, using -R rather than -r and documenting FORGIT_ENTER_PAGER seem worthwhile.
Activity
carlfriedrich commentedon Jun 14, 2026
Thanks for your report. Actually that's exactly the use case for
FORGIT_ENTER_PAGER.I'm not sure we should respect the user's
LESSenv by default, as this could break the intended forgit user experience.We should document the variable, though.
@wfxr @sandr01d @cjappl WDYT?
danielwerg commentedon Jun 14, 2026
I think big red note about setting
LESSis ought to be in docs as well.sandr01d commentedon Jun 16, 2026
I agree with you @carlfriedrich, overriding
$LESSby default to prevent breakage makes sense to me and of course$FORGIT_ENTER_PAGERshould be documented.wfxr commentedon Aug 12, 2026
I looked further into the history, and the
LESSoverride was originally introduced inb27df40specifically to prevent-Ffrom making the Enter pager exit immediately for short output. So changing the default toless -Rwould not be behavior-neutral:-Ris sufficient for ANSI color pass-through, but inherited options such as-F,-E,-X, and-Scan still change the full-screen behavior.Git preserves an existing
LESS, but it also uses command-line options such asless -+Ffor selective overrides. If we want to follow that model, we should first define which Enter-pager behavior forgit needs to guarantee and override those options explicitly. Otherwise, resettingLESSis intentional and should be documented.Either way, using
-Rrather than-rand documentingFORGIT_ENTER_PAGERseem worthwhile.