Skip to content

fix(core): preserve terminal colors in CLI logs#11

Open
kynnyhsap wants to merge 5 commits intogillkyle:mainfrom
kynnyhsap:fix/strip-ansi-log-files
Open

fix(core): preserve terminal colors in CLI logs#11
kynnyhsap wants to merge 5 commits intogillkyle:mainfrom
kynnyhsap:fix/strip-ansi-log-files

Conversation

@kynnyhsap
Copy link
Copy Markdown

This makes ANSI handling consistent across agent-tail: live terminal output keeps child-process colors, while anything written to disk is stripped to plain text. That now applies to wrap, run, and the browser log pipelines used by the Vite and Next.js plugins.

Fixes #9

What does this PR do?

  • preserves child-process ANSI styling in interactive terminal output for wrap and run
  • strips ANSI escape codes before writing service logs, combined.log, and browser logs
  • centralizes ANSI stripping in a shared core helper used by CLI and plugin formatting
  • covers stdout, stderr, and ANSI-colored exclude filtering in CLI tests
  • covers Vite, Next App Router, and Next Pages Router browser log writes

How did you verify your code works?

  • pnpm run build
  • pnpm run test
  • pnpm run typecheck
  • manual wrap verification with colored terminal output and plain log files
  • manual run verification with colored terminal output and plain log files

Notes

  • I reviewed the common npm options (strip-ansi and ansi-regex) and did not add them here. The local helper already covers the escape sequences needed for this fix, keeps the runtime dependency surface smaller, and is now backed by regression tests across the CLI and plugin log paths.

Demo
Before:
CleanShot 2026-03-07 at 20 28 05@2x

After:
CleanShot 2026-03-07 at 20 27 14@2x

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 7, 2026

@kynnyhsap is attempting to deploy a commit to the gillkyle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

agent-tail run strips ANSI color/formatting from console output

1 participant