diff --git a/internal/cli/base.go b/internal/cli/base.go index f64da4d05..ec32e7c13 100644 --- a/internal/cli/base.go +++ b/internal/cli/base.go @@ -182,6 +182,9 @@ func BaseCommand(ctx context.Context, log hclog.Logger, logOutput io.Writer, opt } else if !bc.flagInteractive { // Set non interactive if the --no-interactive flag is provided ui = terminal.NonInteractiveUI(ctx) + } else if !bc.flagColor { + // Set basic ui (with no color) if the --no-color flag is provided + ui = terminal.BasicUI(ctx) } else { // If no ui related flags are set, create a new one ui = terminal.ConsoleUI(ctx) @@ -331,6 +334,9 @@ func (c *baseCommand) Init(opts ...Option) (err error) { } else if !c.flagInteractive { // Set non interactive if the --no-interactive flag is provided ui = terminal.NonInteractiveUI(c.Ctx) + } else if !c.flagColor { + // Set basic ui (with no color) if the --no-color flag is provided + ui = terminal.BasicUI(c.Ctx) } else { // If no ui related flags are set, use the base config ui ui = baseCfg.UI