Merge pull request #404 from abperiasamy/win-color
disable console theme on Windows
This commit is contained in:
+1
-1
@@ -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 {
|
||||
|
||||
+10
-1
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user