diff --git a/tools/utils/style/indent-and-wrap.go b/tools/utils/style/indent-and-wrap.go index b82a693d3..8fd8c667b 100644 --- a/tools/utils/style/indent-and-wrap.go +++ b/tools/utils/style/indent-and-wrap.go @@ -167,8 +167,12 @@ func (self *sgr_state) apply_csi(raw string) { self.reset() case 1: self.dim, self.bold = false, true + case 221: + self.bold = false case 2: self.dim, self.bold = true, false + case 222: + self.dim = false case 22: self.dim, self.bold = false, false case 3: diff --git a/tools/utils/style/indent-and-wrap_test.go b/tools/utils/style/indent-and-wrap_test.go index be81c8112..8cedc744a 100644 --- a/tools/utils/style/indent-and-wrap_test.go +++ b/tools/utils/style/indent-and-wrap_test.go @@ -37,4 +37,10 @@ func TestFormatWithIndent(t *testing.T) { tx("four", "fou\nr") tx("nl\n\n", "nl\n\n") tx("four\n\n", "fou\nr\n\n") + + screen_width = 8 + tx( + "\x1b[1mbold\x1b[221m no more bold", + "\x1b[1mbold\x1b[221m no\nmore\nbold", + ) }