summaryrefslogtreecommitdiffstats
path: root/src/ansi.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-03-23 01:24:31 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-03-23 01:24:31 +0900
commit9d138173be9845fc7f2cbeab58b41f27a1f8043f (patch)
tree4d0961ba630cd49f7e5fffa89a58cb76f39407f9 /src/ansi.go
parenteae53576bd31b6583bb13efc80418d4129e1b813 (diff)
Fix #155 - Empty ANSI color code to reset color state
Diffstat (limited to 'src/ansi.go')
-rw-r--r--src/ansi.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ansi.go b/src/ansi.go
index 42c69166..f4c8f5a0 100644
--- a/src/ansi.go
+++ b/src/ansi.go
@@ -99,6 +99,9 @@ func interpretCode(ansiCode string, prevState *ansiState) *ansiState {
}
ansiCode = ansiCode[2 : len(ansiCode)-1]
+ if len(ansiCode) == 0 {
+ init()
+ }
for _, code := range strings.Split(ansiCode, ";") {
if num, err := strconv.Atoi(code); err == nil {
switch state256 {