mercurial/ui.py
changeset 49130 7afa96d3b484
parent 49037 642e31cb55f0
child 49314 2e726c934fcd
--- a/mercurial/ui.py	Wed Apr 13 14:37:57 2022 -0400
+++ b/mercurial/ui.py	Wed Apr 13 15:02:01 2022 -0400
@@ -1432,6 +1432,14 @@
             # HGPLAINEXCEPT=pager, and the user didn't specify --debug.
             return
 
+        # py2exe doesn't appear to be able to use legacy I/O, and nothing is
+        # output to the pager for paged commands.  Piping to `more` in cmd.exe
+        # works, but is easy to forget.  Just disable pager for py2exe, but
+        # leave it working for pyoxidizer and exewrapper builds.
+        if pycompat.iswindows and getattr(sys, "frozen", None) == "console_exe":
+            self.debug(b"pager is unavailable with py2exe packaging\n")
+            return
+
         pagercmd = self.config(b'pager', b'pager', rcutil.fallbackpager)
         if not pagercmd:
             return