Respect ANSI codes to reset properties

Fix #3441
This commit is contained in:
Junegunn Choi 2023-09-16 19:47:33 +09:00
parent eb4bbf3294
commit 4490b2d209
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -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