# HG changeset patch # User Danek Duvall # Date 2016-10-13 19:01:41 # Node ID 5d777fe4615d6a509ad44c4628d586027dd8c028 # Parent f34a8cff51d9acf24ad4e84cefb253588a90ac8b color: ignore effects missing from terminfo If terminfo mode is in effect, and an effect is used which is missing from the terminfo database, simply silently ignore the request, leaving the output unaffected rather than causing a crash. diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -378,7 +378,10 @@ def _effect_str(effect): if effect.endswith('_background'): bg = True effect = effect[:-11] - attr, val, termcode = _terminfo_params[effect] + try: + attr, val, termcode = _terminfo_params[effect] + except KeyError: + return '' if attr: if termcode: return termcode