Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Setting the TERM environment variable to 'dumb' doesn't prevent use of VT (ANSI) escape sequences by the formatting system #16059

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Prerequisites

Steps to reproduce

Related: #14594 and #16060

While setting the TERM environment variable to 'dumb' does make $host.UI.SupportsVirtualTerminal report $false, the output-formatting system still uses VT (ANSI) escape sequences and produces colored output.

Note: Unlike setting TERM to xtermm / xterm-mono, dumb does not cause $PSStyle.OutputRendering to reflect PlainText (arguably, if PowerShell knows that the terminal doesn't support VT (ANSI) escape sequences, it shouldn't use them, irrespective of the value of $PSStyle.OutputRendering).

# On Unix
sh -c 'TERM=dumb pwsh -c ''Get-Item /'''

Expected behavior

The output shouldn't be colored.

Actual behavior

The output is colored.

Note: On Windows, the equivalent $env:TERM='dumb'; pwsh -nop -c 'Get-Item /' command doesn't render the colors, but outputs the escape sequences as-is, with the ESC char. represented as

Error details

No response

Environment data

PowerShell Core 7.2.0-preview.9

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.