The issue is that clang writes directly to stderr<br><div class="gmail_quote"><div dir="ltr">On Sun, Nov 4, 2018 at 5:38 AM Pavel Labath via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D54072#1286748" rel="noreferrer" target="_blank">https://reviews.llvm.org/D54072#1286748</a>, @zturner wrote:<br>
<br>
> Unfortunately then color output is impossible. Where else would the output<br>
>  be expected to go?<br>
<br>
<br>
If you execute the command over the SB API (SBCommandInterpreter::HandleCommand) then it will go into the provided result object. Also, some clients (typically IDEs) use SetInput/Output/ErrorFileHandle to set what is considered to be the default input/output streams for a given debugger instance (typically, to redirect these to some console window).<br>
<br>
I don't think this directly precludes colored output, although it may require a bit more plumbing to pass the information whether the final consumer is willing to accept color escape codes. (We can already get that via `StreamFile->GetFile().GetIsTerminalWithColors()`, so you would just need to somehow pass this information to the proxy raw_ostream you give to the clang dump function.)<br>
<br>
<br>
<a href="https://reviews.llvm.org/D54072" rel="noreferrer" target="_blank">https://reviews.llvm.org/D54072</a><br>
<br>
<br>
<br>
</blockquote></div>