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.
--- a/hgext/color.py Thu Oct 13 11:48:17 2016 -0700
+++ b/hgext/color.py Thu Oct 13 12:01:41 2016 -0700
@@ -378,7 +378,10 @@
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