Browse Source

Handle ansi code 39 and 49

39 is apparently the "default foreground color"
49 is apparently the "default background color"
tablepad
Sean Smith 3 years ago committed by Trevor Slocum
parent
commit
9aa08ad7c7
  1. 4
      ansi.go

4
ansi.go

@ -145,9 +145,13 @@ func (a *ansi) Write(text []byte) (int, error) { @@ -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)

Loading…
Cancel
Save