diff --git a/cmd-options.go b/cmd-options.go index 3dae820e..8146cf82 100644 --- a/cmd-options.go +++ b/cmd-options.go @@ -207,7 +207,7 @@ var ( flags = []cli.Flag{ cli.StringFlag{ Name: "theme", - Value: "minimal", + Value: console.GetDefaultTheme(), Usage: fmt.Sprintf("Choose a console theme from this list [%s]", func() string { keys := []string{} for key := range console.ThemesDB { diff --git a/pkg/console/console.go b/pkg/console/console.go index 18c9dcb7..6b806e9f 100644 --- a/pkg/console/console.go +++ b/pkg/console/console.go @@ -20,6 +20,7 @@ import ( "errors" "fmt" "os" + "runtime" "sync" "github.com/fatih/color" @@ -30,7 +31,7 @@ var ( mutex = &sync.RWMutex{} // currentTheme is currently set theme - currentTheme = "minimal" + currentTheme = GetDefaultTheme() // ThemesDB contains supported list of Themes ThemesDB = map[string]Theme{"minimal": MiniTheme, "nocolor": NoColorTheme, "white": WhiteTheme} // Fatal prints a fatal message and exits @@ -153,3 +154,11 @@ func SetTheme(themeName string) error { func GetTheme() string { return currentTheme } + +// GetDefaultTheme returns the default theme +func GetDefaultTheme() string { + if runtime.GOOS == "windows" { + return "nocolor" + } + return "minimal" +}