Skip to content

feat(rg): support ansi color numbers - #1700

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

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

Conversation

@chaliy

@chaliy chaliy commented May 23, 2026

Copy link
Copy Markdown
Contributor

What

Support ripgrep-style 8-bit ANSI color numbers in rg --colors specs for foreground and background styles.

Why

Real rg accepts specs like match:fg:5 and emits 38;5;5 ANSI styling. Bashkit previously rejected those specs.

How

  • Parse numeric color values as u8 ANSI 256-color indexes.
  • Emit 38;5; for foreground and 48;5; for background.
  • Add real-rg differential cases for numeric foreground and background colors.

Risk

  • Low
  • Limited to rg --colors parsing and ANSI rendering.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

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 367c870 Commit Preview URL May 23 2026, 01:55 AM

@chaliy
chaliy merged commit 501cec7 into main May 23, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-batch-21 branch May 23, 2026 02:08
chaliy added a commit that referenced this pull request May 30, 2026
## What
Support ripgrep-style 8-bit ANSI color numbers in rg --colors specs for
foreground and background styles.

## Why
Real rg accepts specs like match:fg:5 and emits 38;5;5 ANSI styling.
Bashkit previously rejected those specs.

## How
- Parse numeric color values as u8 ANSI 256-color indexes.
- Emit 38;5;<n> for foreground and 48;5;<n> for background.
- Add real-rg differential cases for numeric foreground and background
colors.

## Risk
- Low
- Limited to rg --colors parsing and ANSI rendering.

## 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