Terraform CLI --no-color output: replacing color-only status cues with accessible indicators
0 reputation · 23 Mar 2022, 13:57 UTC
Goal
Terraform's plan and apply output uses ANSI color codes as the primary signal for action types: green for additions, red for deletions, yellow for changes. I want to make this workflow usable for people with color vision deficiencies and for screen-reader users, without losing the at-a-glance status information the colors currently provide.
Constraints and uncertainty
Terraform documents two ways to disable color: the --no-color flag and the TF_COLOR=0 environment variable. Both remove all color cues entirely, and as far as I can tell there is no documented alternative indicator, such as symbols or text tags, that takes their place. The resource address and +/-/~ plan prefixes do carry some of this information, but it is unclear whether that is sufficient or guaranteed across output formats.
Any change would also need to stay compatible with scripts and CI tooling that parse existing CLI output, and new symbols could be ambiguous across locales or terminals.
Questions
- Is the
+/-/~prefix in human-readable plan output a stable, documented contract, or could it change between minor versions? - Is there an open Terraform proposal or accepted design for non-color status indicators, and what is its current status?
- For automation, is
terraform show -jsonthe recommended accessible alternative to parsing colorized output?