Skip to content

[Bug] Color-disabled normal output still contains ANSI reset codes #330

Description

@equationzhao

Describe the bug
Color-disabled output still contains ANSI escape sequences. This pollutes plain text output and downstream processing.

To Reproduce

  1. Build the current repository:
go build -o /tmp/g-bug-audit .
  1. Create a single file:
tmp=$(mktemp -d)
printf 'x' > "$tmp/a.txt"
  1. Disable colors and inspect control bytes:
/tmp/g-bug-audit --no-config --disable-index --color never --no-icon -A --byline "$tmp" | cat -v
printf '\nexit=%s tmp=%s\n' ${pipestatus[1]:-${PIPESTATUS[0]}} "$tmp"
  1. Actual output:
a.txt^[[0m

exit=0 tmp=/var/folders/1b/57vdxmgj7s1glqm6tbsw1frm0000gn/T/tmp.9F4PuG3JXL
  1. The same problem reproduces with --no-color:
a.txt^[[0m

exit=0 tmp=/var/folders/1b/57vdxmgj7s1glqm6tbsw1frm0000gn/T/tmp.44e4AcyKW4
  1. Expected output:
a.txt

No ESC[0m should be present when color is disabled.

Screenshots
Not applicable.

Info (please complete the following information):

  • OS: macOS darwin/arm64
  • Version: v0.31.2, Go go1.26.1

Additional context
The name rendering path appears to append a reset sequence even when the color level is disabled. --classic does not emit the reset, but --color never and --no-color do.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions