Skip to content

Outputing Exceptions is not honoring no_color and leaves red color on #18050

@simonsabin

Description

@simonsabin

Prerequisites

Steps to reproduce

either run in powershell

$env:no_color="on";pwsh  -noninteractive -Command "$errorview='NormalView';throw 'an Error'"

or run this in a command prompt

set no_color=on&pwsh  -noninteractive -Command "$errorview='NormalView';throw 'an Error'"

Expected behavior

Error is output but in the consoles forecolor

Actual behavior

Error is output in red AND the console prompt stays in red

Error details

No response

Environment data

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

Visuals

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions