fix(terminal): Reset dim SGR independently from bold (#1803)

This commit is contained in:
Pedro Fedricci 2022-11-02 15:24:40 -03:00 committed by GitHub
parent 897038638d
commit ece1cbe533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -545,9 +545,10 @@ impl Display for CharacterStyles {
write!(f, "\u{1b}[2m")?;
},
AnsiCode::Reset => {
if let Some(AnsiCode::Reset) = self.bold {
// we only reset dim if both dim and bold should be reset
write!(f, "\u{1b}[22m")?;
write!(f, "\u{1b}[22m")?;
// ⬑ this SGR also clears bold, so reapply it
if let Some(AnsiCode::On) = self.bold {
write!(f, "\u{1b}[1m")?;
}
},
_ => {},