From e5a2fa0827ada9b6a256f120f0ccfca92e0af529 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 20 Oct 2021 17:20:45 -0700 Subject: [PATCH] Reset all attributes before changing color in rendering --- PSReadLine/Render.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PSReadLine/Render.cs b/PSReadLine/Render.cs index f97877001..354cd8149 100644 --- a/PSReadLine/Render.cs +++ b/PSReadLine/Render.cs @@ -177,7 +177,12 @@ void UpdateColorsIfNecessary(string newColor) { if (!object.ReferenceEquals(newColor, activeColor)) { - if (!inSelectedRegion) _consoleBufferLines[currentLogicalLine].Append(newColor); + if (!inSelectedRegion) + { + _consoleBufferLines[currentLogicalLine] + .Append(VTColorUtils.AnsiReset) + .Append(newColor); + } activeColor = newColor; } }