Exec ConsoleToMSBuild=true doesn't preserve colors
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
@rainersigwald I've spent some time pondering some deep, Confucious stuff lately regarding my build toolchain, and started asking:
"How can I run a .NET Core CLI Tool in an MSBuild Exec Task AND preserve the color output?"
Oh, boy.
Along the way, I found that [MSBuild output itself can emit ANSI Escape Codes to processes like Travis CI](https://github.com/Microsoft/msbuild/issues/1792)... so it got me wondering, why can't MSBuild parse ANSI Escape Codes rather than generate them? Searching StackOverflow, I don't see any good answers. People seem to think fundamentally there is no way to capture color, it's [drastically impractical](https://stackoverflow.com/a/17493515/1040437), because color is a property of the console, not the standard output and error streams. I say, let there be color. [Pastel](https://github.com/silkfire/Pastel), maybe.
Here is a sample repro of the issue:
# build.targets
```xml
```
# Expected Output
"hi" in red.
# Actual Output
"hi" in console default foreground color and default background color
# Deep Thoughts
“I for one believe that if you give people a thorough understanding of what confronts them and the basic causes that produce it, they’ll create their own program, and when the people create a program, you get action.” — Malcolm X
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.