Merged
Conversation
Member
|
@jiasli Should we consider upgrading knack version for the change? |
Member
Author
|
Yes. But let's test it first. We will bump the version when other PRs are merged. |
|
the change will disable color output from az cli totally? |
Member
Author
|
Yes, Colorama won't be initialized with |
…tdout multiple times
Member
|
Member
Author
|
The user can either call If the user runs |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #170, #169. Also reported in Azure/azure-cli#6080 and causes side effect of Azure/azure-cli#9903.
If
stdoutis redirected and CLI displays a colored output, the color in the console can't revert back to the default because Colorama only resets color instdout, but notstderr(tracked at tartley/colorama#200, tartley/colorama#218). This is affecting pip as well: pypa/pip#6354 and pip uses--no-colorto disable coloring pypa/pip#4739. Azure CLI will add this option too.Without proper a fix from Colorama, Knack can now
{CLI}_CORE_NO_COLORenvironment variable.The PR removes Colorma from
out_filewith a Colorma stream and generates colorized output like jsoncself.streamwith a Colorma stream and generates colorized logsStatusTagself.stream.isatty()is removed because Colorama has its own mechanism to detect tty and treat PyCharm as a tty: https://github.com/tartley/colorama/blob/405b982f39efeaf697d3e2a6b90f9b913b38e97d/colorama/ansitowin32.py#L45To test,