Show colors in the output of bref command - #57
Merged
Merged
Conversation
When the output is a terminal, `bref command` asks Bref Cloud for colors: Bref Cloud adds `--ansi` to Laravel and Symfony commands, which otherwise never write colors on Lambda (their output is not a terminal there). The output is printed as it was, the terminal renders the colors. When the output is piped or redirected, nothing changes. Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK
Creating `Bref\Cli\Application` turns warnings into exceptions, and with the lowest dependencies (Symfony Console 5 on PHP 8.2) loading Symfony's `HelperSet` triggers a deprecation notice that then became a fatal error. The test now sets up `IO` like the application does, and runs the command directly. Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK
This was referenced Sep 27, 2026
mnapoli
added this pull request to stack #60
September 27, 2026 20:18
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.
When its output is a terminal,
bref commandnow asks Bref Cloud for colors (ansi: truewhen starting the command). Bref Cloud then adds--ansito Laravel (artisan) and Symfony (bin/console) commands: on Lambda their output is never a terminal, so without it they never write colors. The output is printed as before, and the terminal renders the colors.--ansi, a command that already sets--ansi/--no-ansiis left alone) is made by Bref Cloud: the CLI only says whether it can show colors, from$output->isDecorated()(soNO_COLOR, pipes and redirections disable it).Tested against Bref Cloud with the server side of this change: under a TTY,
bref command aboutprints Laravel's colors (^[[32;1mEnvironment^[[39;22m ...) and a failing command's error block renders in white on red; piped, the output has no escape codes; the current release shows no colors, as before.Commandnow accepts aBrefCloudClientin its constructor, like the other commands, for the newCommandTest.