test: validate ANSI escape codes are not in redirected composer output#134
Merged
AaronFeledy merged 3 commits intomainfrom Feb 28, 2026
Merged
test: validate ANSI escape codes are not in redirected composer output#134AaronFeledy merged 3 commits intomainfrom
AaronFeledy merged 3 commits intomainfrom
Conversation
Adds a test to verify that `lando composer` output does not contain ANSI escape codes when stdout is redirected to a file. This test is expected to FAIL until the fix is applied (removing `--ansi` from the composer tooling command). Ref lando/drupal#157
✅ Deploy Preview for lando-wordpress ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Composer auto-detects TTY and enables color output when appropriate. The --ansi flag forced ANSI escape codes even when stdout was redirected to a file or used in command substitution, breaking scripted usage. Ref lando/drupal#157
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a test that verifies
lando composer --version > file.txtdoes not contain ANSI escape codes in the output file.This test is expected to FAIL on CI until the fix is applied — removing
--ansifrom the composer tooling command.The root cause is
--ansibeing hardcoded in the composer tooling definition. Composer auto-detects TTY when--ansiisn't forced.Ref lando/drupal#157
Note
Low Risk
Low risk change to the default
composertooling command plus a test/doc check; main risk is minor output formatting differences for users relying on forced color.Overview
Prevents ANSI escape codes from appearing in redirected
lando composeroutput by removing the hardcoded--ansiflag from the WordPress recipe’s defaultcomposertooling command.Adds a verification step to the
wordpress-defaultsexample to assert redirectedcomposer --versionoutput contains no ANSI sequences, and documents the change inCHANGELOG.md.Written by Cursor Bugbot for commit 86cceaa. This will update automatically on new commits. Configure here.