Show More
@@ -846,15 +846,6 b' class ui(object):' | |||||
846 | if not pagercmd: |
|
846 | if not pagercmd: | |
847 | return |
|
847 | return | |
848 |
|
848 | |||
849 | if pycompat.osname == 'nt': |
|
|||
850 | # `more` cannot be invoked with shell=False, but `more.com` can. |
|
|||
851 | # Hide this implementation detail from the user, so we can also get |
|
|||
852 | # sane bad PAGER behavior. If args are also given, the space in the |
|
|||
853 | # command line forces shell=True, so that case doesn't need to be |
|
|||
854 | # handled here. |
|
|||
855 | if pagercmd == 'more': |
|
|||
856 | pagercmd = 'more.com' |
|
|||
857 |
|
||||
858 | self.debug('starting pager for command %r\n' % command) |
|
849 | self.debug('starting pager for command %r\n' % command) | |
859 | self.flush() |
|
850 | self.flush() | |
860 | self.pageractive = True |
|
851 | self.pageractive = True | |
@@ -881,6 +872,21 b' class ui(object):' | |||||
881 | # simple pager command configurations, we can degrade |
|
872 | # simple pager command configurations, we can degrade | |
882 | # gracefully and tell the user about their broken pager. |
|
873 | # gracefully and tell the user about their broken pager. | |
883 | shell = any(c in command for c in "|&;<>()$`\\\"' \t\n*?[#~=%") |
|
874 | shell = any(c in command for c in "|&;<>()$`\\\"' \t\n*?[#~=%") | |
|
875 | ||||
|
876 | if pycompat.osname == 'nt' and not shell: | |||
|
877 | # Window's built-in `more` cannot be invoked with shell=False, but | |||
|
878 | # its `more.com` can. Hide this implementation detail from the | |||
|
879 | # user so we can also get sane bad PAGER behavior. MSYS has | |||
|
880 | # `more.exe`, so do a cmd.exe style resolution of the executable to | |||
|
881 | # determine which one to use. | |||
|
882 | fullcmd = util.findexe(command) | |||
|
883 | if not fullcmd: | |||
|
884 | self.warn(_("missing pager command '%s', skipping pager\n") | |||
|
885 | % command) | |||
|
886 | return | |||
|
887 | ||||
|
888 | command = fullcmd | |||
|
889 | ||||
884 | try: |
|
890 | try: | |
885 | pager = subprocess.Popen( |
|
891 | pager = subprocess.Popen( | |
886 | command, shell=shell, bufsize=-1, |
|
892 | command, shell=shell, bufsize=-1, |
General Comments 0
You need to be logged in to leave comments.
Login now