-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add $env:__SuppressAnsiEscapeSequences
to control whether to have VT escape sequence in output
#10814
Conversation
update select-string cmdlet to support this update ConciseView to support this update Get-Error to support this add tests
src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
$OutputPreference
to control whether to have VT escape sequence in output$env:SuppressAnsiEscapeSequences
to control whether to have VT escape sequence in output
$env:SuppressAnsiEscapeSequences
to control whether to have VT escape sequence in output$env:__SuppressAnsiEscapeSequences
to control whether to have VT escape sequence in output
The remaining CodeFactor issue is wrong. Looks like it's looking at an older version of that source file. |
...stem.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1
Outdated
Show resolved
Hide resolved
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Remaining Codacy issues are by-design |
Why not add a command line option instead? It's somewhat common to support an option like |
@lzybkr This would cause this to be needed in a lot of places in testing. |
@lzybkr you mean cmdline option to pwsh? |
🎉 Handy links: |
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. UpdatedSelect-String
,ConciseView
, andGet-Error
to respect this variable. Also added helper to retrieve VT escape sequences.PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.$OutputPreference
MicrosoftDocs/PowerShell-Docs#4947