Skip to content

Commit 7edfa93

Browse files
authored
Reset all attributes before changing color in rendering to avoid color leaking (#2925)
1 parent 1280763 commit 7edfa93

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PSReadLine/Render.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ void UpdateColorsIfNecessary(string newColor)
177177
{
178178
if (!object.ReferenceEquals(newColor, activeColor))
179179
{
180-
if (!inSelectedRegion) _consoleBufferLines[currentLogicalLine].Append(newColor);
180+
if (!inSelectedRegion)
181+
{
182+
_consoleBufferLines[currentLogicalLine]
183+
.Append(VTColorUtils.AnsiReset)
184+
.Append(newColor);
185+
}
181186
activeColor = newColor;
182187
}
183188
}

0 commit comments

Comments
 (0)