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")?; write!(f, "\u{1b}[2m")?;
}, },
AnsiCode::Reset => { AnsiCode::Reset => {
if let Some(AnsiCode::Reset) = self.bold { write!(f, "\u{1b}[22m")?;
// we only reset dim if both dim and bold should be reset // ⬑ this SGR also clears bold, so reapply it
write!(f, "\u{1b}[22m")?; if let Some(AnsiCode::On) = self.bold {
write!(f, "\u{1b}[1m")?;
} }
}, },
_ => {}, _ => {},