Add a reset before and after colorized output
This is how GNU's ls --color works, and it clears up problems in xterm and
Windows command prompt windows.
--- a/hgext/color.py Wed Jul 23 20:33:23 2008 -0500
+++ b/hgext/color.py Tue Jul 15 18:10:37 2008 -0500
@@ -79,11 +79,12 @@
def render_effects(text, *effects):
'Wrap text in commands to turn on each effect.'
- start = []
+ start = [ str(_effect_params['none'][0]) ]
stop = []
for effect in effects:
start.append(str(_effect_params[effect][0]))
stop.append(str(_effect_params[effect][1]))
+ stop.append(str(_effect_params['none'][1]))
start = '\033[' + ';'.join(start) + 'm'
stop = '\033[' + ';'.join(stop) + 'm'
return start + text + stop