From 0865d703048dfbc2e949e34a681fecb34aacba32 Mon Sep 17 00:00:00 2001 From: Mohammadreza Asadollahifard Date: Wed, 23 Jul 2025 23:05:18 +0100 Subject: [PATCH] refactor: change default color output setting to auto and remove ColorEnabled method Signed-off-by: Mohammadreza Asadollahifard --- pkg/cli/environment.go | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index 111338e8a..c5f87cf24 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -231,8 +231,8 @@ func envColorMode() string { return v } } - // Default to never (disabled) until more commands support color - return "never" + // Default to auto + return "auto" } func (s *EnvSettings) EnvVars() map[string]string { @@ -288,24 +288,7 @@ func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter { return s.config } -// ColorEnabled returns true if color output should be enabled based on the ColorMode setting -func (s *EnvSettings) ColorEnabled() bool { - switch s.ColorMode { - case "never": - return false - case "always": - return true - case "auto": - // Auto mode is handled by fatih/color's built-in terminal detection - // We just need to not override it - return true - default: - return true - } -} - // ShouldDisableColor returns true if color output should be disabled -// This is the inverse of ColorEnabled for backward compatibility with noColor parameters func (s *EnvSettings) ShouldDisableColor() bool { return s.ColorMode == "never" }