From 4490b2d209cf23ea7d29d216bea7b146ded02ef9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 16 Sep 2023 19:47:33 +0900 Subject: [PATCH] Respect ANSI codes to reset properties Fix #3441 --- src/ansi.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ansi.go b/src/ansi.go index 24acc39..05e0861 100644 --- a/src/ansi.go +++ b/src/ansi.go @@ -381,10 +381,19 @@ func interpretCode(ansiCode string, prevState *ansiState) ansiState { state.attr = state.attr | tui.Reverse case 9: state.attr = state.attr | tui.StrikeThrough + case 22: + state.attr = state.attr &^ tui.Bold + state.attr = state.attr &^ tui.Dim case 23: // tput rmso state.attr = state.attr &^ tui.Italic case 24: // tput rmul state.attr = state.attr &^ tui.Underline + case 25: + state.attr = state.attr &^ tui.Blink + case 27: + state.attr = state.attr &^ tui.Reverse + case 29: + state.attr = state.attr &^ tui.StrikeThrough case 0: state.fg = -1 state.bg = -1