Reset all attributes before changing color in rendering to avoid color leaking (#2925)

This commit is contained in:
Dongbo Wang
2021-10-20 17:48:13 -07:00
committed by GitHub
parent 1280763116
commit 7edfa93cd2
+6 -1
View File
@@ -177,7 +177,12 @@ namespace Microsoft.PowerShell
{
if (!object.ReferenceEquals(newColor, activeColor))
{
if (!inSelectedRegion) _consoleBufferLines[currentLogicalLine].Append(newColor);
if (!inSelectedRegion)
{
_consoleBufferLines[currentLogicalLine]
.Append(VTColorUtils.AnsiReset)
.Append(newColor);
}
activeColor = newColor;
}
}