[PATCH V3] pager: fix the invocation of `more` on Windows
Yuya Nishihara
yuya at tcha.org
Fri Mar 24 10:17:46 EDT 2017
On Thu, 23 Mar 2017 21:57:50 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1489983573 14400
> # Mon Mar 20 00:19:33 2017 -0400
> # Node ID d0c2db2d9f13dca534c598de050eb1919ef79059
> # Parent df82f375fa005b9c71b463182e6b54aa47fa5999
> pager: fix the invocation of `more` on Windows
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -844,6 +844,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'
Given MSYS nor MSYS2 doesn't provide more.exe by default, this seems fine.
Can we document this hack in help just in case someone installed more.exe?
More information about the Mercurial-devel
mailing list