Skip to content

Commit

Permalink
Adjust color escape sequence to support windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mschenk42 committed Jan 1, 2017
1 parent 75b7b61 commit 483bd4c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"text/template"

Expand Down Expand Up @@ -250,7 +249,7 @@ type colorFormater struct {
}

func (c colorFormater) hasColor() bool {
return (c.color || isatty.IsTerminal(os.Stdout.Fd())) && runtime.GOOS != "windows"
return (c.color || isatty.IsTerminal(os.Stdout.Fd()))
}

func (c colorFormater) white(bold bool) string {
Expand All @@ -259,7 +258,7 @@ func (c colorFormater) white(bold bool) string {
attrBold = 1
}
if c.hasColor() {
return fmt.Sprintf("\033[%d;%dm%%s\033[0m", attrBold, 97)
return fmt.Sprintf("\x1b[%d;%dm%%s\x1b[0m", attrBold, 97)
}
return "%s"
}
Expand All @@ -270,7 +269,7 @@ func (c colorFormater) green(bold bool) string {
attrBold = 1
}
if c.hasColor() {
return fmt.Sprintf("\033[%d;%dm%%s\033[0m", attrBold, 32)
return fmt.Sprintf("\x1b[%d;%dm%%s\x1b[0m", attrBold, 32)
}
return "%s"
}
Expand Down

0 comments on commit 483bd4c

Please sign in to comment.