[llvm] [llvm] Do not use Console API if the output isn't a console device (PR #90230)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 15 11:10:45 PDT 2024


alvinhochun wrote:

I am not opposed to the idea of making ANSI escape codes the default on Windows when the output is redirected, and also for console output if supported by the system. But currently this patch only does the former.

Besides, in the case of Clang, it has the option `-f[no-]ansi-escape-codes` which currently defaults to 0. I'm not sure if this option is useful any more, but I don't think we should remove it because [CMake now sets this flag](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8900/diffs). We also can't just change its default either because that would break colour output when running on older versions of Windows. We should make it such that if neither options are specified, ANSI escape code is enabled depending on whether `ENABLE_VIRTUAL_TERMINAL_PROCESSING` is supported. Or maybe we can just make the option no-op.

https://github.com/llvm/llvm-project/pull/90230


More information about the llvm-commits mailing list