ui: rerun color.setup() once the pager has spawned to honor 'color.pagermode'
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 25 Mar 2017 19:17:11 -0400
changeset 31696 c3ca0ad8ab9c
parent 31695 2d11d278279a
child 31697 cf052cc5c2c2
ui: rerun color.setup() once the pager has spawned to honor 'color.pagermode' Otherwise, ui.pageractive is False when color is setup in dispatch.py (without --pager=on), and this config option is ignored.
mercurial/ui.py
--- a/mercurial/ui.py	Sat Mar 25 21:12:00 2017 -0400
+++ b/mercurial/ui.py	Sat Mar 25 19:17:11 2017 -0400
@@ -867,6 +867,12 @@
             # auto-detection of things being formatted.
             self.setconfig('ui', 'formatted', wasformatted, 'pager')
             self.setconfig('ui', 'interactive', False, 'pager')
+
+            # If pagermode differs from color.mode, reconfigure color now that
+            # pageractive is set.
+            cm = self._colormode
+            if cm != self.config('color', 'pagermode', cm):
+                color.setup(self)
         else:
             # If the pager can't be spawned in dispatch when --pager=on is
             # given, don't try again when the command runs, to avoid a duplicate