Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Oct 9, 2019

PR Summary

If you cut and paste a multi-line script into the console (or type it), and there is an error, without this change it just shows the short error message. However, since it's multiple lines, it makes sense to still show the context of the line number. Fix is to allow showing the line context information if the scriptlinenumber is greater than 1 even if there isn't a script file.

img

PR Context

PR Checklist

@iSazonov
Copy link
Collaborator

iSazonov commented Oct 10, 2019

Feedback which is not related the PR.
image

Make sense to print error message on new line?

ParserError:
Line |
   1 | $a=Get-Process -Id $PID | Format-List * | Out-Default | Select-String "Container" | 0/1
     |                                                                                     ^ 
     | Expressions are only allowed as the first element of a pipeline.

Screenshot after I decrease windows width
image

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 10, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.5 milestone Oct 10, 2019
@iSazonov iSazonov merged commit 36bc894 into PowerShell:master Oct 10, 2019
@SteveL-MSFT
Copy link
Member Author

@iSazonov can you open a new issue to discuss? Another option is to truncate long lines (not the error message, but the line causing the problem) which NormalView already does today.

@SteveL-MSFT SteveL-MSFT deleted the errorview-lines branch October 10, 2019 14:16
@iSazonov
Copy link
Collaborator

Done.

@ghost
Copy link

ghost commented Oct 23, 2019

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

Handy links:

kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request Nov 9, 2019
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.

4 participants