# HG changeset patch # User Kyle Lippincott # Date 2018-07-16 18:38:56 # Node ID d79f3afb079e66305adf634f513ae65f195824bf # Parent c382c19ce9bd5c335beae197e82e7cda2a213eb2 curses: use "text" interface if TERM=dumb Differential Revision: https://phab.mercurial-scm.org/D3948 diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1214,7 +1214,7 @@ class ui(object): "Feature %s does not handle all default interfaces" % feature) - if self.plain(): + if self.plain() or encoding.environ.get('TERM') == 'dumb': return "text" # Default interface for all the features diff --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t --- a/tests/test-commit-interactive-curses.t +++ b/tests/test-commit-interactive-curses.t @@ -368,6 +368,16 @@ If only the default is set, we'll use th $ chunkselectorinterface curses +If TERM=dumb, we use text, even if the config says curses + $ chunkselectorinterface + curses + $ TERM=dumb chunkselectorinterface + text +(Something is keeping TERM=dumb in the environment unless I do this, it's not +scoped to just that previous command like in many shells) + $ TERM=xterm chunkselectorinterface + curses + It is possible to override the default interface with a feature specific interface $ cp $HGRCPATH.pretest $HGRCPATH