Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Feb 18, 2020

PR Summary

This is a bit of an edge case. Where the error message is wider than the console window width and doesn't contain whitespace, then it doesn't get rendered as the calculation to split the string uses a negative index. Fix is to check that the string length subtracting the prefix length is greater than 0 before getting a substring, otherwise, just use it.

PR Context

#11827

PR Checklist

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Feb 19, 2020
@iSazonov iSazonov added this to the 7.1.0-preview.1 milestone Feb 19, 2020
@SteveL-MSFT
Copy link
Member Author

@PoshChan please retry linux, windows

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, successfully started retry of PowerShell-CI-Linux, PowerShell-CI-Windows

@ghost
Copy link

ghost commented Mar 26, 2020

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

@SteveL-MSFT SteveL-MSFT deleted the errorview-width branch June 6, 2020 02:30
silijon pushed a commit to SkyKick/PowerShell that referenced this pull request Jul 2, 2020
…esn't have whitespace (PowerShell#11880)

# Conflicts:
#	src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
#	test/powershell/engine/Formatting/ErrorView.Tests.ps1
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.

5 participants