-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Repro steps:
- Open the latest PowerShell preview.7, and make sure using the default prompt
- Run
$ErrorView = 'NormalView' - Run
Write-Error 'error'
This is a bug introduced by #17705.
The Cosnole.ForegroundColor and Console.BackgroundColor were changed but never set back after writing out the message.
Lines 1299 to 1307 in 1ee27cf
| if ($ErrorView -ne 'ConciseView' -and $null -ne $host.PrivateData) { | |
| if ($null -ne $host.PrivateData.ErrorForegroundColor) { | |
| [Console]::ForegroundColor = $host.PrivateData.ErrorForegroundColor | |
| } | |
| if ($null -ne $host.PrivateData.ErrorBackgroundColor) { | |
| [Console]::BackgroundColor = $host.PrivateData.ErrorBackgroundColor | |
| } | |
| } |
Expected behavior
The prompt after executing `Write-Error 'error'` doesn't have the color changedActual behavior
The prompt gets changed to the error colorError details
N/AEnvironment data
Name Value
---- -----
PSVersion 7.3.0-preview.7
PSEdition Core
GitCommitId 7.3.0-preview.7
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
