question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Write-Verbose / Write-Warning / Write-Debug colors linger after execution

See original GitHub issue

Note: This is a regression from 7.1. It affects all terminals on all platforms.

Executing a Write-Verbose / Write-Warning / Write-Debug command that produces visible - and therefore colored - output makes the colors linger and affects subsequent output (that doesn’t explicitly control coloring)

Update: The problem is connected to the PSAnsiRendering experimental feature and does not occur while it is disabled.

Steps to reproduce

Write-Warning foo; 'bar'

Expected behavior

foo should print in yellow, bar in the default colors.

Actual behavior

Both foo and bar print in yellow, and the subsequent prompt string prints in yellow too.

Environment data

PowerShell Core 7.2.0-preview.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
SeeminglySciencecommented, Dec 28, 2020

Strange, I’m not able to reproduce with 7.1 or 7.2 preview 2.

Make sure you have the experimental feature enabled. I did the same thing the other day. (Speaking of which, FYI @rjmholt. I forget what thread I said that in.)

1reaction
ThomasNietocommented, Dec 28, 2020

Strange, I’m not able to reproduce with 7.1 or 7.2 preview 2.

Make sure you have the experimental feature enabled. I did the same thing the other day. (Speaking of which, FYI @rjmholt. I forget what thread I said that in.)

Enabling PSAnsiRendering allowed me to reproduce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I colour Write-Debug and Write-Verbose a ...
I have a simple aim here but the execution seems relatively complex. All I would like to do is format Write-Debug and Write-Verbose...
Read more >
Thoughts On When To Use – Write-Host, Write-Output, Write ...
Write-Warning has a color coding that catches the attention of the user. Use this when you want to let the user know that...
Read more >
Write-Warning (Microsoft.PowerShell.Utility)
The Write-Warning cmdlet writes a warning message to the PowerShell host. The response to the warning depends on the value of the user's...
Read more >
Terminal-Icons (PowerShell Module) 0.11.0
Terminal-Icons is a PowerShell module that adds file and folder icons when displaying items in the terminal. This relies on the custom fonts...
Read more >
(PDF) windows poweshell.pdf | Billy otieno
1. In Control Panel, open Add Or Remove Programs. · 2. From the list of Currently Installed Programs, select Microsoft Windows PowerShell Step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found