mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix use of accent colors for hosts that don't support them (#10937)
This commit is contained in:
+10
-4
@@ -759,7 +759,12 @@ namespace System.Management.Automation.Runspaces
|
||||
$newline = [Environment]::Newline
|
||||
$output = [System.Text.StringBuilder]::new()
|
||||
$prefix = ' ' * $indent
|
||||
$accentColor = Get-VT100Color $Host.PrivateData.FormatAccentColor
|
||||
$accentColor = ''
|
||||
|
||||
if ($null -ne $Host.PrivateData) {
|
||||
$accentColor = Get-VT100Color ($Host.PrivateData.FormatAccentColor ?? $Host.PrivateData.ErrorForegroundColor)
|
||||
}
|
||||
|
||||
$expandTypes = @(
|
||||
'Microsoft.Rest.HttpRequestMessageWrapper'
|
||||
'Microsoft.Rest.HttpResponseMessageWrapper'
|
||||
@@ -1004,9 +1009,10 @@ namespace System.Management.Automation.Runspaces
|
||||
|
||||
$errorColor = ''
|
||||
$accentColor = ''
|
||||
if ($Host.PrivateData) {
|
||||
$errorColor = Get-VT100Color -color $Host.PrivateData.ErrorForegroundColor
|
||||
$accentColor = Get-VT100Color -color $Host.PrivateData.ErrorAccentColor
|
||||
|
||||
if ($null -ne $Host.PrivateData) {
|
||||
$errorColor = Get-VT100Color $Host.PrivateData.ErrorForegroundColor
|
||||
$accentColor = Get-VT100Color ($Host.PrivateData.ErrorAccentColor ?? $errorColor)
|
||||
}
|
||||
|
||||
$posmsg = ''
|
||||
|
||||
Reference in New Issue
Block a user