diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 5c39be02f..c9cabfd27 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -1992,6 +1992,12 @@ pub fn setAttribute( .unknown => return, } + // If the attribute didn't change our style then we can skip the + // style update entirely: our current style ID is already correct. + // This is a common case in the wild where programs re-assert the + // same style repeatedly (e.g. per span or per line). + if (self.cursor.style.eql(old_style)) return; + try self.manualStyleUpdate(); }