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
Fix error formatting to use color defined in $PSStyle.Formatting
#17987
Conversation
...stem.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
Show resolved
Hide resolved
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? |
|
/backport to release/v7.3.0-rc.1 |
|
@adityapatwardhan backporting to release/v7.3.0-rc.1 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix error formatting to use color defined in '$PSStyle.Formatting'
Using index info to reconstruct a base tree...
M src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
Falling back to patching base and 3-way merge...
Auto-merging src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
CONFLICT (content): Merge conflict in src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix error formatting to use color defined in '$PSStyle.Formatting'
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
Handy links: |
|
/backport to release/v7.2.7 |
|
@adityapatwardhan backporting to release/v7.2.7 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix error formatting to use color defined in '$PSStyle.Formatting'
Using index info to reconstruct a base tree...
M src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
M src/System.Management.Automation/engine/InitialSessionState.cs
Falling back to patching base and 3-way merge...
Auto-merging src/System.Management.Automation/engine/InitialSessionState.cs
CONFLICT (content): Merge conflict in src/System.Management.Automation/engine/InitialSessionState.cs
Auto-merging src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
CONFLICT (content): Merge conflict in src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix error formatting to use color defined in '$PSStyle.Formatting'
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |


PR Summary
Fix #17885, and supersede #17904
Also fix the short-term goal as described in #17886 (comment)
$PSStyle.Formatting, when the host supports virtual terminal.$PSStylea constant variable, so it cannot be removed.ConciseViewto use correct color and reset the color properly when the host supports virtual terminal.Note that, when the host doesn't support virtual terminal, the error formatting will continue to use color settings in
$Host.PrivateDatato keep consistent with the legacy behavior.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.