Comment #0 by timothee.cour2 — 2014-02-27T12:26:50Z
clang and many other compilers have colorized error messages, it improves a lot readability such as pinpointing where the error is etc. I suggest having 'dmd -color' flag to colorize error/warning messages as well.
As we've seen with the recent introduction of '-vcolumns' flag, simple things like this improve quite a bit the experience.
This is trivial to implement on posix with terminal codes (I'm using it myself for my own logging), and should be doable on windows as well (SetConsoleTextAttribute?).
Comment #1 by dlang-bugzilla — 2014-02-27T12:28:50Z
Comment #2 by andrej.mitrovich — 2014-02-27T12:37:25Z
Seems like something that should or could be done in RDMD, especially since I've seen a few colorizing console libraries implemented in D.
Comment #3 by bugzilla — 2014-02-27T13:03:22Z
It's a good idea.
Note to implementer: You'd have to check to see if the output stream is a file or a tty, and not do the colorizing for the file.
Comment #4 by timothee.cour2 — 2014-02-27T13:06:33Z
Using a postprocessor seems fragile/ambiguous.
Come to think of it probably the most flexible solution would be to have a flag
to output with markup (json for example), that can later be used by tools to
print as html/terminal color codes/etc.
Comment #5 by bus_dbugzilla — 2014-02-28T14:32:45Z
Instead of a flag, wouldn't it be better to just do what the unixy tools do and automatically colorize if-and-only-if it detects it's outputting to an interactive shell? (Not sure whether that's doable on Windows though.)
As long as it's a flag, the TTY detection is not so important. If someone can figure out that part, we could make it the default and do away with the flag.
Comment #9 by github-bugzilla — 2014-07-02T11:08:35Z