terragrunt icon indicating copy to clipboard operation
terragrunt copied to clipboard

Disable color output

Open pete0emerson opened this issue 2 years ago • 2 comments

is there any way to disable the colored output from the terragrunt binary?

 ~ $ terragrunt plan --help | grep color
  -no-color           If specified, output won't contain any color.
 ~ $ terragrunt apply --help | grep color
  -no-color              If specified, output won't contain any color.

that removes the color output from the terraform runs, not from the terragrunt runs. the output from the CI pipeline into github has a lot of these strings �[4m{�[0m�[0m i suppose those are color strings/encodings for terminal

What is the terragrunt command that your pipeline is running?

cd <dir>; terragrunt plan -no-color-out=$planfile

Ah, and it's suppressing terraform color but still generating terragrunt output in color?

Correct

pete0emerson avatar May 19 '22 15:05 pete0emerson

hi, most probably will help setting env variable TF_CLI_ARGS="-no-color"

https://github.com/hashicorp/terraform/issues/23708#issuecomment-571676112

https://github.com/hashicorp/terraform/issues/15264

denis256 avatar May 26 '22 10:05 denis256

TF_CLI_ARGS="-no-color"

That does not works, at least for hclfmt

image

That's is from the logger https://github.com/gruntwork-io/terragrunt/blob/master/util/logger.go

And can be disabled by "set DisableColors field to true" https://github.com/sirupsen/logrus#formatters

At the same time, in CI envs it should works perfectly

MaxymVlasov avatar Jul 06 '22 11:07 MaxymVlasov

Resolved in v0.48.7 release.

levkohimins avatar Aug 09 '23 16:08 levkohimins