On Mon, Oct 27, 2014 at 6:51 PM, Eric Fiselier <[email protected]> wrote: > >But what if Lit isn't running in a device capable of color output? Won't > >this add a bunch of ugly ASCII codes? > > Wouldn't clang refrain from outputting color codes to begin with? >
I believe it doesn't know any better, if you've given it a pseudoterminal capable of colours, it'll go for it. > Do you know of any way to detect this? > The same way clang, lit, and FileCheck detect it, I suppose... (I'm sure there's some API in libSupport, though I realize that won't be directly usable from this python, but might give you some inspiration) > > >I think what tools like Ninja do is to also optionally strip the color > >codes in that case ( > >https://github.com/martine/ninja/blob/master/src/util.cc#L384). > > Not much you can do about that. At least the colored output makes it one > step further. > Agreed (& note that FileCheck is also a great candidate for this). For now I just use the compiler flags in cmake to force Clang's colours on. This doesn't work if I want to redirect, of course, and doesn't work for FileCheck (due to lit) nor lit (due to Ninja) - having an option to force these things on would be fine by me too, so I could do the same with those tools as I do with clang (& indeed if you make this change to lit and give me a "force colours" flag (or manage to get it in without the terminal detection so it's just always on - but I suspect that'd be bad, as Daniel pointed out) then I might not need a flag for FileCheck and I can remove the flag passing I have for clang... ) > > Thanks for the input. > > http://reviews.llvm.org/D6010 > > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
