Skip to content

Add ConciseView for $ErrorView#10641

Merged
anmenaga merged 26 commits intoPowerShell:masterfrom
SteveL-MSFT:errorview
Oct 4, 2019
Merged

Add ConciseView for $ErrorView#10641
anmenaga merged 26 commits intoPowerShell:masterfrom
SteveL-MSFT:errorview

Conversation

@SteveL-MSFT
Copy link
Copy Markdown
Member

@SteveL-MSFT SteveL-MSFT commented Sep 27, 2019

PR Summary

Add new ConciseView as Experimental Feature. When this ExperimentalFeature is enabled, it defaults to ConciseView, otherwise, it defaults to NormalView. CategoryView is still supported.
With new ConciseView, if the error is not from a script or parser error, then it's a single line error message. Otherwise, you get a multiline error message that isn't all red showing the script file (if available), line
that contains the error and a pointer and error message showing where the error is in that line. If the terminal doesn't support Virtual Terminal, then vt100 color codes are not used. The error message within the line display will wrap at whitespace making it easier to read.

A new $Host.PrivateData.ErrorAccentColor member is added so users can customize the color. $ErrorView is now of type [System.Management.Automation.ErrorView] instead of a string.

Some cleanup to the formatting script with regards to double double quotes vs single quotes where appropriate. Also changed the PositionMessage when truncating to use unicode ellipsis instead of 3 dots.

Imgur

PR Context

Implement $ErrorView part of PowerShell/PowerShell-RFC#228

Fix #3647

PR Checklist

Loading
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

7 participants