##// END OF EJS Templates
color: use ui.formatted() to test TTYness, not sys.stdout.isatty()...
Brodie Rao -
r14103:a36e8c99 default
parent child Browse files
Show More
@@ -301,13 +301,15 b' def uisetup(ui):'
301 301 global _terminfo_params
302 302 if ui.plain():
303 303 return
304
305 formatted = (os.environ.get('TERM') != 'dumb' and ui.formatted())
304 306 mode = ui.config('color', 'mode', 'auto')
305 307 if mode == 'auto':
306 308 if os.name == 'nt' and 'TERM' not in os.environ:
307 309 # looks line a cmd.exe console, use win32 API or nothing
308 310 mode = w32effects and 'win32' or 'none'
309 311 else:
310 if getattr(sys.stdout, 'isatty', None) and sys.stdout.isatty():
312 if not formatted:
311 313 _terminfo_params = False
312 314 else:
313 315 _terminfosetup(ui)
@@ -332,8 +334,7 b' def uisetup(ui):'
332 334 auto = coloropt == 'auto'
333 335 always = util.parsebool(coloropt)
334 336 if (always or
335 (always is None and
336 (auto and (os.environ.get('TERM') != 'dumb' and ui_.formatted())))):
337 (always is None and auto and formatted)):
337 338 colorui._colormode = mode
338 339 colorui.__bases__ = (ui_.__class__,)
339 340 ui_.__class__ = colorui
General Comments 0
You need to be logged in to leave comments. Login now