From 9aa08ad7c7ec3eb820cc7b53ded6d36c882962e3 Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Fri, 13 Sep 2019 20:12:34 -0400 Subject: [PATCH] Handle ansi code 39 and 49 39 is apparently the "default foreground color" 49 is apparently the "default background color" --- ansi.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansi.go b/ansi.go index 346450a..f84800c 100644 --- a/ansi.go +++ b/ansi.go @@ -145,9 +145,13 @@ func (a *ansi) Write(text []byte) (int, error) { case "30", "31", "32", "33", "34", "35", "36", "37": colorNumber, _ := strconv.Atoi(field) foreground = lookupColor(colorNumber-30, false) + case "39": + foreground = "default" case "40", "41", "42", "43", "44", "45", "46", "47": colorNumber, _ := strconv.Atoi(field) background = lookupColor(colorNumber-40, false) + case "49": + background = "default" case "90", "91", "92", "93", "94", "95", "96", "97": colorNumber, _ := strconv.Atoi(field) foreground = lookupColor(colorNumber-90, true)