Skip to content

fix(cli): ASCII box/separator chars in CI + respect NO_COLOR in output-renderer#4455

Open
PeterPonyu wants to merge 2 commits into
code-yeongyu:devfrom
PeterPonyu:fix/cli-ascii-no-color-only
Open

fix(cli): ASCII box/separator chars in CI + respect NO_COLOR in output-renderer#4455
PeterPonyu wants to merge 2 commits into
code-yeongyu:devfrom
PeterPonyu:fix/cli-ascii-no-color-only

Conversation

@PeterPonyu

@PeterPonyu PeterPonyu commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Scope-isolated replacement for #4310 (closed: 25-commit mixed-scope branch — content overlapped with #4002 / #4003 / #4305).

Two commits, six files, addresses two CLI rendering issues in CI/non-color environments.

Changes

  1. fix(cli): substitute ASCII box chars in CI — `format-verbose.ts` and `install-validators.ts` detect `CI` / `GITHUB_ACTIONS` at module load and emit `-`, `|`, `+` instead of Unicode box-drawing chars that produce mojibake in CI log viewers.
  2. `fix(cli)`: respect NO_COLOR in output-renderer — `colorizeWithProfileColor` now skips truecolor ANSI escapes when `NO_COLOR`, `CI`, `GITHUB_ACTIONS`, or `TERM=dumb` is set. Stops raw `\e[38;2;...` from leaking into non-color terminals.
  3. `fix(cli)`: import-order cleanup — trivial blank line between external and local imports in `output-renderer.ts`.

Files

File Change
`src/cli/doctor/format-verbose.ts` ASCII fallback
`src/cli/doctor/formatter.test.ts` test for ASCII substitution
`src/cli/install-validators.ts` ASCII fallback
`src/cli/install-validators.test.ts` test
`src/cli/run/output-renderer.ts` NO_COLOR truecolor gate + import order
`src/cli/run/output-renderer.test.ts` NO_COLOR escape suppression test

Verification

```
bun run typecheck # clean
bun test src/cli/doctor/formatter.test.ts src/cli/install-validators.test.ts src/cli/run/output-renderer.test.ts

15 pass, 0 fail, 36 expect() calls

```

Why split

#4310 accidentally bundled 25 commits from a feature-stacking branch (roles-models == #4002, TUI export == #4305, agent-handoff XML escape == follow-up to #4003) plus these CLI fixes. Closing #4310 in favor of this scoped subset; the other scopes already have their own PRs.


Summary by cubic

Use ASCII box/separator characters in CI and skip truecolor ANSI when color is disabled, fixing garbled CI logs and raw escape codes in non-color environments.

  • Bug Fixes
    • format-verbose.ts and install-validators.ts now use ASCII - | + when CI or GITHUB_ACTIONS is set.
    • output-renderer.ts stops emitting truecolor escapes when NO_COLOR, CI, GITHUB_ACTIONS, or TERM=dumb is set.
    • Added tests for CI ASCII fallbacks and NO_COLOR handling; minor import cleanup in output-renderer.ts.

Written for commit 2647f76. Summary will update on new commits. Review in cubic

PeterPonyu and others added 2 commits May 25, 2026 04:23
… output-renderer

Terminal emulators in CI (GitHub Actions and generic CI) do not render
box-drawing Unicode characters reliably, producing mojibake in logs.
format-verbose.ts and install-validators.ts now detect CI/GITHUB_ACTIONS
at module load time and substitute ASCII equivalents (-, |, +) for the
Unicode line/box chars.

output-renderer.ts: colorizeWithProfileColor now skips truecolor ANSI
escape sequences when NO_COLOR, CI, GITHUB_ACTIONS, or TERM=dumb is set,
preventing raw \e[38;2;... codes from leaking into non-color terminals.

output-renderer.test.ts (new): verifies that NO_COLOR suppresses
truecolor escapes from renderAgentHeader.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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