From 27909807c2babf754dea396db1ebdb6306807b98 Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Fri, 27 Feb 2026 17:58:31 -0600 Subject: [PATCH 1/3] test: add ANSI escape code validation for redirected composer output 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 --- examples/wordpress-defaults/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/wordpress-defaults/README.md b/examples/wordpress-defaults/README.md index 1783e96..69882ab 100644 --- a/examples/wordpress-defaults/README.md +++ b/examples/wordpress-defaults/README.md @@ -56,6 +56,9 @@ lando mysql -u root -e "show variables;" | grep innodb_lock_wait_timeout | grep # Should use composer 2 by default lando exec appserver -- /bin/sh -c 'NO_COLOR=1 composer -V' | grep "Composer version 2." + +# Should not include ANSI escape codes when output is redirected +lando composer --version > /tmp/composer-output.txt 2>&1 && ! grep -P '\x1b\[' /tmp/composer-output.txt ``` ## Destroy tests From b4aef2111bf7d16a2ef02e1f22b6ddeebfa3f0cc Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Fri, 27 Feb 2026 18:18:26 -0600 Subject: [PATCH 2/3] fix: remove --ansi flag from composer tooling command 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 --- builders/wordpress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/wordpress.js b/builders/wordpress.js index 848ef18..deb0c6c 100644 --- a/builders/wordpress.js +++ b/builders/wordpress.js @@ -88,7 +88,7 @@ const getDatabaseType = options => { const toolingDefaults = { 'composer': { service: 'appserver', - cmd: 'composer --ansi', + cmd: 'composer', }, 'db-import ': { service: ':host', From 86cceaa2cabe19f78cb1fd761efe52c7bdbcea36 Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Fri, 27 Feb 2026 18:20:00 -0600 Subject: [PATCH 3/3] docs: add CHANGELOG entry for --ansi removal --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3cd5c7..7525312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) * Updated to [@lando/nginx@1.6.0](https://github.com/lando/nginx/releases/tag/v1.6.0) +* Removed `--ansi` flag from composer tooling command to prevent escape codes in redirected output ## v1.10.1 - [February 22, 2026](https://github.com/lando/wordpress/releases/tag/v1.10.1)