mercurial/ui.py
changeset 31592 c5d924e5dfdb
parent 31588 37a0ad669051
child 31624 c60091fa1426
--- a/mercurial/ui.py	Wed Mar 22 16:36:53 2017 -0700
+++ b/mercurial/ui.py	Mon Mar 20 00:19:33 2017 -0400
@@ -846,6 +846,15 @@
         if not pagercmd:
             return
 
+        if pycompat.osname == 'nt':
+            # `more` cannot be invoked with shell=False, but `more.com` can.
+            # Hide this implementation detail from the user, so we can also get
+            # sane bad PAGER behavior.  If args are also given, the space in the
+            # command line forces shell=True, so that case doesn't need to be
+            # handled here.
+            if pagercmd == 'more':
+                pagercmd = 'more.com'
+
         self.debug('starting pager for command %r\n' % command)
         self.flush()
         self.pageractive = True