Skip to content

Add $env:__SuppressAnsiEscapeSequences to control whether to have VT escape sequence in output - #10814

Merged
Travis Plunk (TravisEz13) merged 11 commits into
PowerShell:masterfrom
SteveL-MSFT:outputpreference
Oct 24, 2019
Merged

Travis Plunk (TravisEz13) merged 11 commits into
PowerShell:masterfrom
SteveL-MSFT:outputpreference

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 17, 2019 •

Copy link
Copy Markdown
Member

PR Summary

After some discussion, we decided we want to spend more time on the design for customer facing use. Since we need this due to issues with AzDevOps pipelines having some rendering problems, we will make it an undocumented env var for now to use internally and revisit this post PS7 as part of #10811.

Introduce $env:__SuppressAnsiEscapeSequences to suppress VT escape sequences in their output. Updated Select-String, ConciseView, and Get-Error to respect this variable. Also added helper to retrieve VT escape sequences.

PR Checklist

update select-string cmdlet to support this
update ConciseView to support this
update Get-Error to support this
add tests
@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Oct 17, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title Add $OutputPreference to control whether to have VT escape sequence in output Add $env:SuppressAnsiEscapeSequences to control whether to have VT escape sequence in output Oct 18, 2019
@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title Add $env:SuppressAnsiEscapeSequences to control whether to have VT escape sequence in output Add $env:__SuppressAnsiEscapeSequences to control whether to have VT escape sequence in output Oct 18, 2019
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

The remaining CodeFactor issue is wrong. Looks like it's looking at an older version of that source file.

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 18, 2019
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 18, 2019
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Remaining Codacy issues are by-design

Comment thread .vsts-ci/linux.yml Resolved
@lzybkr

Copy link
Copy Markdown
Contributor

Why not add a command line option instead?

It's somewhat common to support an option like --color [always|auto|never].

@TravisEz13

Copy link
Copy Markdown
Member

Jason Shirk (@lzybkr) This would cause this to be needed in a lot of places in testing.

@TravisEz13
Travis Plunk (TravisEz13) merged commit 4ff9924 into PowerShell:master Oct 24, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the outputpreference branch October 24, 2019 20:42
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Jason Shirk (@lzybkr) you mean cmdline option to pwsh?

@lzybkr

Copy link
Copy Markdown
Contributor

Steve Lee (@SteveL-MSFT) - exactly. There are many tools that have such an option, mostly with the same syntax and options - here's a sampling:

@PaulHigin Paul Higinbotham (PaulHigin) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 19, 2019
@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants