Skip to content

Print the output of bref command as is - #59

Merged
mnapoli merged 1 commit into
mainfrom
command-raw-output
Sep 28, 2026
Merged

mnapoli merged 1 commit into
mainfrom
command-raw-output

Conversation

@mnapoli

@mnapoli mnapoli commented Sep 27, 2026

Copy link
Copy Markdown
Member

Stacked on #57.

bref command wrote the output of the command through Symfony Console's formatter, so text from the application that looks like its tags was interpreted rather than printed:

  • <href=https://...>text</> became a terminal hyperlink,
  • <info>, <comment>, <error> became colors when the output is a terminal, and disappeared when it is piped or redirected.

The output of an application is not written for Symfony Console's formatter (and it can contain data from the application's database), so it's now written with OutputInterface::OUTPUT_RAW, exactly as received: the success output, and the output of a failed command under its ERROR header. The CLI's own lines (spinner, headers) keep their formatting.

Colors requested with --ansi (#57) are raw escape codes, so they're not affected.

Tested with a new case in CommandTest: Hello <info>world</info>, <href=https://example.com>a link</> comes out verbatim, in a terminal and piped, for a successful and a failed command.

@mnapoli
mnapoli added this pull request to stack #60 September 27, 2026 20:18
Base automatically changed from command-ansi-colors to main September 28, 2026 12:29
It was written through Symfony Console's formatter, so text from the application that looks like
its tags was interpreted: `<href=...>` became a terminal hyperlink, `<info>` and `<error>` became
colors, or disappeared when the output is not a terminal.

Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK
@mnapoli
mnapoli merged commit ea58773 into main Sep 28, 2026
4 checks passed
@mnapoli
mnapoli deleted the command-raw-output branch September 28, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant