-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Set the environment variable to enable colorful output by default #288
Comments
Hi @Tyrrrz, we will take a look at this, thank you for your contribution! |
Update: according to this comment, setting |
@Tyrrrz, it seems to me the setting of these variables is out of scope |
I understand your point, but here's why I think it makes sense as an addition to
That said, there may be some edge-cases such as if some step relies on the output of a In any case, I leave the decision with you :) I'm personally okay setting this manually for my own projects. |
Great suggestion @Tyrrrz! I'm in favor of this as well and brings this inline with some of the other colored output we see in Actions and other setup scripts as well (with node/etc). This seems like a small, but useful, thing to see in the unformatted log views. I think you identified a possible case (item 3 above) that could be a possibility, but could be easily gated with another input on the action ( I'd love to see this in. |
This is actually the case with |
I've started to maintain a composite action that wraps this one and implements features that aren't yet supported. I just added this feature to it in case anyone's interested in trying it out. https://github.com/xt0rted/setup-dotnet |
I'm going to close this issue. More details in the PR: #293 |
Description:
.NET previously disabled console colors if it detected that the output was redirected. Recently, a new environment variable has been added to override this: dotnet/runtime#47935
Setting below environment variables will enable colorful output when running on GitHub Actions (not on Windows though):
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION
to1
ortrue
TERM
toxterm
More info: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_system_console_allow_ansi_color_redirection
Relevant discussion explaining the need for the second variable: dotnet/runtime#68302 (comment)
Justification:
Colorful output is much easier to visually parse and, since we can guarantee that we're always running on GitHub Actions (which supports ansi color escape codes), it makes sense to make this setting enabled by default. As the worst case, this should be at least added as one of the action inputs,
but I think enabling it by default is the way to go(not anymore, read comments below).Are you willing to submit a PR?
Sure
The text was updated successfully, but these errors were encountered: