Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1264,17 +1264,17 @@ function Get-ConciseViewPositionMessage {
}
}
else {
$message += $err.ErrorDetails.Message
$message += $err.ErrorDetails.Message
}

# FIX #24108: Always normalize newlines for ConciseView consistency
$message = $message.Replace($newline, ' ').Replace("`n", ' ').Replace("`t", ' ')

# if rendering line information, break up the message if it's wider than the console
if ($myinv -and $myinv.ScriptName -or $err.CategoryInfo.Category -eq 'ParserError') {
$prefixLength = [System.Management.Automation.Internal.StringDecorated]::new($prefix).ContentLength
$prefixVtLength = $prefix.Length - $prefixLength

# replace newlines in message so it lines up correct
$message = $message.Replace($newline, ' ').Replace("`n", ' ').Replace("`t", ' ')

$windowWidth = 120
if ($Host.UI.RawUI -ne $null) {
$windowWidth = $Host.UI.RawUI.WindowSize.Width
Expand Down