Uh oh!
There was an error while loading. Please reload this page.
Add possibility to write ANSI color escape codes when the console output is redirected - #47935
Conversation
ghost
commented
Feb 5, 2021
Tagging subscribers to this area: Issue DetailsThis introduces an opt-in mechanism to allow writing ANSI color escape codes even when the console output is redirected. To enable ANSI color codes, the Fixes #33980
|
ejsmith
commented
Feb 6, 2021
Nice! Thanks for doing this! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
stephentoub
commented
Feb 8, 2021
Direction for #33980 needs to be resolved first. @KathleenDollard, please chime in. |
ethomson
commented
Feb 15, 2021
I'm sorry, but I must still disagree that this is the correct direction. CI providers already have a standard mechanism that they use to communicate that you're running in a CI environment. For better or worse, this is the status quo; tools detect the CI environment and adapt their behavior accordingly. By introducing a novel variable, that means that you're expecting the CI systems to start setting it. I don't mean to sound negative or difficult, but we will not, if for the practical reason that there are many more applications in the world than there are CI systems and there's already an established mechanism where the apps check to see if they're running in CI. We simply can't set dozens or hundreds (or more?) of environment variables. (I apologize if your change is orthogonal to CI systems, but that was certainly my interest in and understanding of #33980.) |
0xced
commented
Mar 5, 2021
Yes, this change is absolutely orthogonal to CI systems. The modification proposed here is at the Unix Console platform abstraction layer and should certainly not have anything remotely related to CI environment variables. By the way, I just rebased on the |
0239f02 to
0798728Compare0798728 to
0dbfbb3Comparejeffhandley
commented
Apr 18, 2021
Since #33980 still has some open topics, I'm going to mark this PR as a Draft until those details are solidified. |
ghost
commented
May 18, 2021
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
0xced
commented
May 19, 2021
|
ejsmith
commented
May 20, 2021
Pretty damn sad. This seems like a really nice thing to have and an easy win. |
0dbfbb3 to
829989dComparestephentoub
commented
Jul 2, 2021
@0xced, I pushed a commit to your branch that:
@dotnet/area-system-console, please review. |
ejsmith
commented
Jul 3, 2021
@stephentoub this looks good. Thank you! My only question is if converting the stored int to a bool on every single console write would be a perf hit over just storing the calculated bool value? |
You're welcome.
No, it won't be measurable. It's just I do need to delete an erroneous assert that's the cause of the test failures. |
829989d to
339f800Comparetmds
commented
Jul 5, 2021
@stephentoub when |
stephentoub
commented
Jul 5, 2021
Thanks. I can fix the test for when in CI for that. I don't think there's a product issue here, though; if you don't have TERM set, you can set it. Agreed? Or is there a larger concern I'm not aware of? |
tmds
commented
Jul 6, 2021
Yes, it can be set. I don't know if it is expected to be set in the CI environment variables |
…put is redirected This introduces an opt-in mechanism to allow writing ANSI color escape codes even when the console output is redirected. To enable ANSI color codes, the `DOTNET_CONSOLE_ANSI_COLOR` environment variable must be set to `true` (case insensitive) or `1`. Fixesdotnet#33980
339f800 to
5fb9588Compare
This introduces an opt-in mechanism to allow writing ANSI color escape codes even when the console output is redirected.
To enable ANSI color codes, the
DOTNET_CONSOLE_ANSI_COLORenvironment variable must be set totrue(case insensitive) or1.Fixes#33980