Add no-color compatibility (#1646)

pull/1648/head
M. Efe Çetin 2021-12-07 14:50:29 +03:00 committed by GitHub
parent a5b2b8989b
commit f74dd882ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
app.go
View File

@ -1155,7 +1155,7 @@ func (app *App) startupMessage(addr string, tls bool, pids string) {
}
out := colorable.NewColorableStdout()
if os.Getenv("TERM") == "dumb" || (!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd())) {
if os.Getenv("TERM") == "dumb" || os.Getenv("NO_COLOR") == "1" || (!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd())) {
out = colorable.NewNonColorable(os.Stdout)
}