Repository navigation
feat: add test:console-color command to verify color tag rendering (framework#1571) - #158
Closed
goravel-agent wants to merge 1 commit into
Closed
goravel-agent wants to merge 1 commit into
goravel-agent wants to merge 1 commit into
Conversation
…ramework#1571) Bumps github.com/goravel/framework to v1.18.1-0.20261013093243-4da928651f19 (head of framework#1571), which restores <red>/<fg=green> tag rendering after pterm v0.12.84 dropped gookit/color. The test:console-color command prints every case in one run: prefix printers, tag forms with exact rendered bytes, color.StripColor on tagged/raw-ANSI/mixed input, TwoColumnDetail tagged-vs-pre-colored layout, and the color.Disable()/Enable() toggle.
hwbrzzl
force-pushed
the
implement/2026-10-15-pr1571-color-tags
branch
from
October 17, 2026 02:02
4e53ae3 to
e07ca33
Compare
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.
Summary
github.com/goravel/frameworktov1.18.1-0.20261013093243-4da928651f19, the head of framework PR #1571, restoring<red>/<fg=green>color-tag rendering that pterm v0.12.84 had dropped.go run . artisan test:console-color, one manual run that shows the prefix printers, the style/fg/bg/nested tag forms with their exact rendered bytes,color.StripColorover tagged, raw-ANSI, and mixed input, andTwoColumnDetailtagged-vs-pre-colored layout matching.color.Enable()/color.Disable(), prints the disable/enable toggle section, and reports the disabled-entry notice instead of failing when--no-ansialready latched color off.Why
Goravel renders console color tags such as
<fg=green>ok</>through gookit/color. Framework PR #1571 ("restore color tag rendering for pterm v0.12.84 via gookit/color") re-addedgookit/colorv1.6.1 as a direct dependency after pterm v0.12.84 stopped bundling it, so tags are parsed again instead of leaking as literal text. This branch bumps the example app to that PR head and adds a runnable command that demonstrates the restored behavior from the example app itself, so a future dependency update cannot silently regress it. The bump also pulls in the PR head's transitive dependency drift: gookit/color v1.6.1, pterm v0.12.84, go-runewidth v0.0.31, and the newer otel/x/grpc versions that commit requires.Before the bump, tags printed literally, so colored output had to be pre-rendered by hand, and
support/consolemeasured column widths on the raw tag text, which skewed alignment. After the bump, tags resolve to ANSI and widths are measured on the rendered text, so the tagged and pre-colored forms produce identical layout. Runninggo run . artisan test:console-colorin a fresh process prints all of those cases, including alayout match: trueline and theStripColorresults for tagged, raw-ANSI, and mixed input; a regression now shows up as literal<fg=green>text in the output. When color was already latched off (for example by--no-ansi), the command says so and returns without failing, and if tags are still cleared after forcingcolor.Enable()it reports that rendering is broken with a non-zero exit.