Write-Verbose / Write-Warning / Write-Debug colors linger after execution
See original GitHub issueNote: 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:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.