Skip to content

Terragrunt still outputting color codes with --no-color flag #4008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 2 tasks
ag-TJNII opened this issue Mar 12, 2025 · 3 comments
Open
1 of 2 tasks

Terragrunt still outputting color codes with --no-color flag #4008

ag-TJNII opened this issue Mar 12, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@ag-TJNII
Copy link

Describe the bug

$ terragrunt --no-color --version
^[]11;rgb:0000/0000/0000^Gterragrunt version v0.75.6

Steps To Reproduce

Run terragrunt --no-color --version in a terminal that doesn't honor the color escapes used.

Expected behavior

Terragrunt should not output any color escape sequences when --no-color is passed, even if that escape sequence should be neutral.

Nice to haves

  • Terminal output
  • Screenshots

Versions

  • Terragrunt version: v0.75.6
  • OpenTofu/Terraform version: OpenTofu v1.9.0
  • Environment details (Ubuntu 20.04, Windows 10, etc.): Alpine Linux

Additional context

Add any other context about the problem here.

@ag-TJNII ag-TJNII added the bug Something isn't working label Mar 12, 2025
@yhakbar
Copy link
Collaborator

yhakbar commented Mar 12, 2025

@ag-TJNII Are you sure this isn't your terminal?

I just ran the following:

$ terragrunt --no-color --version &> /tmp/output

And didn't see any escape sequences there. Same with terragrunt --no-color plan.

@ag-TJNII
Copy link
Author

I do think my terminal is a factor but it's a factor in that it's making it visible. No other commands are doing this. Terragrunt 0.66 doesn't output these control codes.

I tried messing with $TERM but that had no impact. If I pipe the output through cat it behaves as expected, regardless of the --no-color flag:

$ terragrunt --no-color --version | cat
terragrunt version v0.75.6
$ terragrunt --version | cat           
terragrunt version v0.75.6

Same with backgrounding it:

$ terragrunt --version &
[1] 294
terragrunt version v0.75.6
[1]+  Done                    terragrunt --version

So it looks like it outputs that control sequence if it detects a TTY.

@yhakbar
Copy link
Collaborator

yhakbar commented Mar 14, 2025

@ag-TJNII

Do you have a reliable way I can reproduce this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants