Skip to content
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

Weird output in powershell for commands tagged as preview. #12084

Closed
shenmuxiaosen opened this issue Feb 6, 2020 · 5 comments
Closed

Weird output in powershell for commands tagged as preview. #12084

shenmuxiaosen opened this issue Feb 6, 2020 · 5 comments
Assignees
Labels
Core CLI core infrastructure OKR3.2 Candidate

Comments

@shenmuxiaosen
Copy link
Contributor

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
When I run CLI preview commands in Powershell script, the output messed up. It returned a message "Command group is in preview. It may be changed/removed in a future release" as expected but followed by a black chunk. It looks like the command hanged but actually it has return value just not able to see it in terminal. When I copied and pasted to notepad, I can see the expected return value.

Also when I started virtual environment and removed is_preview=True for the same command, the problem resolved. So I believe the preview help message somehow changed the Powershell background color or font color to be invisible in terminal.

To Reproduce
Run any preview CLI commands in Powershell. For example:
$x = $(az appconfig list -g YourResourceGroup)
Write-Host $x

This issue only happened when I run in a standalone Powershell script. It worked fine in Powershell ISE.

Expected behavior
It should return properly instead of a black chunk.

Environment summary
Windows-10-10.0.18362-SP0
Python 3.6.6
Shell: cmd.exe (PowerShell Core 6.2.4 64-bit)

azure-cli 2.0.80

Additional context
None

@arrownj arrownj added Core CLI core infrastructure and removed triage labels Feb 7, 2020
@arrownj
Copy link
Contributor

arrownj commented Feb 7, 2020

Hi @jiasli , could you please help take a look at this ?

@yonzhan yonzhan added this to the S166 milestone Feb 7, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 7, 2020

add to S166.

@jiasli
Copy link
Member

jiasli commented Feb 7, 2020

Here is a similar screenshot of what is happening:

This is the same issue as #6080.

Root cause: #6080 (comment)
Fix (TODO): #6080 (comment)

@yonzhan yonzhan modified the milestones: S166, S167 Mar 7, 2020
@yonzhan yonzhan modified the milestones: S167, S169 Mar 21, 2020
@jiasli
Copy link
Member

jiasli commented Apr 20, 2020

Without a proper fix from Colorama, we have added an option to disable color in #12604:

[Core] PREVIEW: Allow disabling color by setting AZURE_CORE_NO_COLOR environment variable to True or [core] no_color=True config (#12601)

@jiasli
Copy link
Member

jiasli commented Jan 20, 2021

This issue has been fixed. Please see #6080 (comment) for the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core CLI core infrastructure OKR3.2 Candidate
Projects
None yet
Development

No branches or pull requests

4 participants