# HG changeset patch # User Xidorn Quan # Date 2016-11-11 02:06:05 # Node ID e193870eb680985042a41a6ba6e4a42b18b49bda # Parent 038547a14d850f14ecd2671852093dc07848a134 color: show mode warning based on ui.formatted ui.interactive is only for input and ui.formatted is for output. diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -275,8 +275,8 @@ def _modesetup(ui, coloropt): def modewarn(): # only warn if color.mode was explicitly set and we're in - # an interactive terminal - if mode == realmode and ui.interactive(): + # a formatted terminal + if mode == realmode and ui.formatted(): ui.warn(_('warning: failed to set color mode to %s\n') % mode) if realmode == 'win32':