summaryrefslogtreecommitdiffstats
path: root/src/ansi.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansi.go')
-rw-r--r--src/ansi.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ansi.go b/src/ansi.go
index f4c8f5a0..126a9920 100644
--- a/src/ansi.go
+++ b/src/ansi.go
@@ -33,7 +33,7 @@ func (s *ansiState) equals(t *ansiState) bool {
var ansiRegex *regexp.Regexp
func init() {
- ansiRegex = regexp.MustCompile("\x1b\\[[0-9;]*m")
+ ansiRegex = regexp.MustCompile("\x1b\\[[0-9;]*[mK]")
}
func extractColor(str *string) (*string, []ansiOffset) {
@@ -87,6 +87,9 @@ func interpretCode(ansiCode string, prevState *ansiState) *ansiState {
} else {
state = &ansiState{prevState.fg, prevState.bg, prevState.bold}
}
+ if ansiCode[len(ansiCode)-1] == 'K' {
+ return state
+ }
ptr := &state.fg
state256 := 0