From a049b1e2f2d9b31c4a57c3f97239aff6dfce5840 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Mon, 28 Sep 2026 18:49:03 +0200 Subject: [PATCH] Run osls without colors, even when FORCE_COLOR is set When `FORCE_COLOR` is set (by some CI systems, or by coding agents), osls colors its output even though it isn't a terminal. The output of `serverless info` then can't be parsed, so `bref deploy` fails after the stack was deployed, and the deployment logs contain escape codes. `--no-color` isn't enough: osls's color library gives `FORCE_COLOR` precedence. The CLI now sets `FORCE_COLOR=0` for osls (3 and 4). Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK --- src/Components/ServerlessFramework.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Components/ServerlessFramework.php b/src/Components/ServerlessFramework.php index f30f431..f6adbe0 100644 --- a/src/Components/ServerlessFramework.php +++ b/src/Components/ServerlessFramework.php @@ -223,6 +223,9 @@ private function serverlessExec(string $oslsPackage, string $command, string $en 'AWS_ACCESS_KEY_ID' => $awsCredentials['accessKeyId'], 'AWS_SECRET_ACCESS_KEY' => $awsCredentials['secretAccessKey'], 'AWS_SESSION_TOKEN' => $awsCredentials['sessionToken'], + // The output is parsed (`serverless info`) and pushed as the deployment logs: no colors, even when + // `FORCE_COLOR` is set, e.g. by a CI or an agent (`--no-color` doesn't win over `FORCE_COLOR`) + 'FORCE_COLOR' => '0', ]; // Merge the current environment with the AWS credentials $env = array_merge(getenv(), $env);