this is from VS code, also happens in PowerShell 7.3 in Windows Terminal
the code is this:
write-host "text text text" -ForegroundColor Magenta -BackgroundColor white
that's just for a test, but it happens a lot more often when write-host
is inside a big script and the background colors just keep dragging outside the text. how can I prevent this from happening? been having this problem for a couple of months.
p.s the correct word for this seems to be bleeding, so PowerShell write-host
color bleeding is happening.
$PSStyle
variable:Write-Host "$($PSStyle.Foreground.Magenta)$($PSStyle.Background.White)text text text$($PSStyle.Reset)"
-- this explicitly resets the style which should avoid any "bleeding" into the command-line. – Theretofore