internal/flags: use stdout, not stderr for terminal detection

This commit is contained in:
Péter Szilágyi 2023-09-14 10:27:10 +03:00
parent 2cda964ba6
commit c6454cd601

View file

@ -30,7 +30,7 @@ import (
// usecolor defines whether the CLI help should use colored output or normal dumb
// colorless terminal formatting.
var usecolor = (isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd())) && os.Getenv("TERM") != "dumb"
var usecolor = (isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())) && os.Getenv("TERM") != "dumb"
// NewApp creates an app with sane defaults.
func NewApp(usage string) *cli.App {