-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console colors do not always revert back to default #6080
Comments
I have seen something like this happen inconsistently in CMD as well. |
az keyvault certificate show
hijacks Powershell console colors when certificate not found
Any updates? This issue is from a year ago and is currently still a problem in the latest version of az cli in combination with Powershell |
@jiasli please take a look and comment. |
This is a PowerShell issue. Issue created: PowerShell/PowerShell#10729 |
This also happens in cmd, which is a colorama issue tartley/colorama#200. Root cause provided by tartley/colorama#200 (comment). |
Can this issue be left open until the colorama issue is resolved, or until the az cli provides a mitigation? My team encounters this issue almost daily, and it makes the product seem unprofessional. Even if the root cause belongs to another product, the az cli owns some responsibility by selecting the dependency. I would accept an option to disable colors altogether. As it stands I am considering wrapping my PowerShell functions which use the az cli in try/finally blocks to ensure the terminal colors revert to their original values. |
Hi @abarger-bss, sure we can reopen this issue. I have created an issue in Knack to allow disabling color. I will work on this to disable colored output. |
Hi @abarger-bss, actually even pip is affected by this issue pypa/pip#6354. Given the condition that there is no better python lib for coloring, I have created PR microsoft/knack#171 to allow disabling color. |
Just adding that for me, this happens regardless of the command, but any time there is a failure or a warning, all the output from then on turns either red or yellow, including the prompt. |
This issue can be solved after PR #12604 is merged. We are planing to include the change in this release. |
This issue has been fixed by microsoft/knack#209 in Azure CLI 2.18.0. Azure CLI can now disable color automatically if |
The
az keyvault certificate show
changes the foreground and background console text colors when the requested certificate is not found, but does not revert the colors when the command is complete.The color change remains in place until
$Host.UI.RawUI.ForegroundColor/$Host.UI.RawUI.BackgroundColor
is manually reset, or until a new session/host process is created.Environment summary
Install Method:
MSI
CLI version:
OS version:
Windows 10 v1709, Build 16299.309
Shell Type:
The text was updated successfully, but these errors were encountered: