Skip to content

feat(rg): add ansi color output - #1686

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-12
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-12

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds ANSI color output support for rg when --color=always or --color=ansi is requested.

Why

Bashkit accepted --color as a no-op. Real rg highlights paths, line numbers, numeric prefix fields, and match spans when forced color is enabled.

How

  • Parses --color modes and keeps non-TTY auto colorless.
  • Emits real-rg default ANSI sequences for paths, line numbers, column/byte fields, and matches.
  • Colors normal match lines, only-matching output, counts/list paths, and --files path listings.
  • Adds byte-exact real-rg differential cases plus unit coverage.

Risk

  • Low / Medium
  • Only affects output when color is explicitly forced; auto/default remain colorless.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 3199cbb Commit Preview URL May 22 2026, 06:56 PM

@chaliy
chaliy merged commit 13a9d56 into main May 22, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-batch-12 branch May 22, 2026 22:50
chaliy added a commit that referenced this pull request May 30, 2026
## What
Adds ANSI color output support for rg when `--color=always` or
`--color=ansi` is requested.

## Why
Bashkit accepted `--color` as a no-op. Real rg highlights paths, line
numbers, numeric prefix fields, and match spans when forced color is
enabled.

## How
- Parses `--color` modes and keeps non-TTY `auto` colorless.
- Emits real-rg default ANSI sequences for paths, line numbers,
column/byte fields, and matches.
- Colors normal match lines, only-matching output, counts/list paths,
and `--files` path listings.
- Adds byte-exact real-rg differential cases plus unit coverage.

## Risk
- Low / Medium
- Only affects output when color is explicitly forced; `auto`/default
remain colorless.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered
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