Skip to content

Console color doesn't reset after error when output is redirected #13979

@scabana

Description

@scabana

Describe the bug

After some errors, console color doesn't reset. This is similar to #6080.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

For example, but not limited to this example:

  1. az login
  2. wait for token expire
  3. az keyvault secret list --vault-name somekeyvault
  4. az prints: Get Token request returned http error: 400 and server response: {"error":"interaction_required","error_description":"AADSTS50078: Presented multi-factor authentication has expired due to policies configured by your administrato...
  5. echo Hey
  6. "Hey" is now red

Expected Behavior

Console color resets to original color.

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Installer: MSI

azure-cli 2.6.0 *

Extensions:
aks-preview 0.4.50
azure-devops 0.18.0

Additional Context

❯ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

CoreCLI core infrastructureService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions