Fix inconsistent newline stripping in ConciseView (#24108)#27160
Open
reabr wants to merge 8 commits into
Open
Conversation
Contributor
Author
|
Hi team 👋 Just checking in is there anything I can do to help move this forward? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes inconsistent $ErrorView = 'ConciseView' formatting so multiline error messages are normalized the same way regardless of whether the error comes from a direct script invocation or a wrapper/module path. It updates the core formatter logic that builds concise error output in System.Management.Automation.
Changes:
- Moves newline/tab normalization so it runs for all ConciseView messages, not only when line details are shown.
- Preserves the existing line-wrapping branch for script/parser errors after the message has been normalized.
|
There was an error handling pipeline event b86f760d-f17a-4b02-93fa-0251da0ef538. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes inconsistent newline handling in
$ErrorView = 'ConciseView'where multi-line error messages were sometimes collapsed to a single line and sometimes preserved, depending on whether the error originated from a direct function call or a wrapper/module call.Problem
In
ConciseView, the code that strips\r\nand\nfrom error messages was wrapped inside a conditional block: