pager: add a config knob to just globally turn off the pager
authorAugie Fackler <augie@google.com>
Tue, 07 Feb 2017 17:13:25 -0500
changeset 31062 88203f26ea57
parent 31061 900996da577a
child 31066 c962bb6af909
pager: add a config knob to just globally turn off the pager
mercurial/help/pager.txt
mercurial/ui.py
--- a/mercurial/help/pager.txt	Tue Feb 07 00:07:53 2017 -0500
+++ b/mercurial/help/pager.txt	Tue Feb 07 17:13:25 2017 -0500
@@ -26,3 +26,10 @@
   - require the pager: `yes` or `on`.
   - suppress the pager: `no` or `off` (any unrecognized value
   will also work).
+
+To globally turn off all attempts to use a pager, set::
+
+  [pager]
+  enable = false
+
+which will prevent the pager from running.
--- a/mercurial/ui.py	Tue Feb 07 00:07:53 2017 -0500
+++ b/mercurial/ui.py	Tue Feb 07 17:13:25 2017 -0500
@@ -857,6 +857,7 @@
         if (self._disablepager
             or self.pageractive
             or command in self.configlist('pager', 'ignore')
+            or not self.configbool('pager', 'enable', True)
             or not self.configbool('pager', 'attend-' + command, True)
             # TODO: if we want to allow HGPLAINEXCEPT=pager,
             # formatted() will need some adjustment.