summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGokcehan <gokcehankara@gmail.com>2021-05-30 20:43:17 +0300
committerGokcehan <gokcehankara@gmail.com>2021-05-30 20:43:17 +0300
commiteaaf08e42504f5986b919ca4690d876424cee4e9 (patch)
treec29cf83cf89bf38362a87f48e33f93119be6ec76
parentf885af55f25042f24572b09d560478a0b3c1bbad (diff)
ignore erase line escape coder23
cc #440
-rw-r--r--ui.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui.go b/ui.go
index 54c864b..da93dfb 100644
--- a/ui.go
+++ b/ui.go
@@ -171,7 +171,7 @@ func printLength(s string) int {
r, w := utf8.DecodeRuneInString(s[i:])
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
- j := strings.IndexByte(s[i:min(len(s), i+64)], 'm')
+ j := strings.IndexAny(s[i:min(len(s), i+64)], "mK")
if j == -1 {
continue
}
@@ -199,12 +199,13 @@ func (win *win) print(screen tcell.Screen, x, y int, st tcell.Style, s string) t
r, w := utf8.DecodeRuneInString(s[i:])
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
- j := strings.IndexByte(s[i:min(len(s), i+64)], 'm')
+ j := strings.IndexAny(s[i:min(len(s), i+64)], "mK")
if j == -1 {
continue
}
-
- st = applyAnsiCodes(s[i+2:i+j], st)
+ if s[i+j] == 'm' {
+ st = applyAnsiCodes(s[i+2:i+j], st)
+ }
i += j
continue