Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add blink style support #2930

Open
ClaireCJS opened this issue Nov 11, 2024 · 3 comments
Open

add blink style support #2930

ClaireCJS opened this issue Nov 11, 2024 · 3 comments
Labels
enhancement An enhancement to the functionality of the software. help wanted Others are encouraged to work on this issue.

Comments

@ClaireCJS
Copy link

Describe your feature request

Enact GREP_COLOR variable configuration

Please describe the behavior you want and the motivation. Please also provide
examples of how ripgrep would be used if your feature request were added.

I currently have both these variables set:

GREP_COLOR=mt=42;5;185
GREP_COLORS=mt=42;5;185

It causes my matched grep text to be blinking white on green.... A deliberately annoying choice made to grab my attention. Not sure which one of the 2 is the one "doing" it; it depends on which year of grep release you use. Both is safest for me. And sometimes it requires --color=always to make it happen. My grep is basically aliased to --color=always -i

Been enjoying this for years if not decades, but today hit a wall with file encoding that just won't grep a simple word out of a simple log file unless i type it and pipe it to grep, which I don't like.

So I discovered ripgrep.

It cuts through the file encoding and gives me my results just fine, but obviously not in the ridiculous color I want. I love its speed and simplicity, but I also love the colors I have been using for years/decades.

Here's a visual example of what I'm getting at:

image

If you're not sure what to write here, then try imagining what the ideal
documentation of your new feature would look like in ripgrep's man page. Then
try to write it.

Probably just a copy of the gnu doc for the --color feature

@BurntSushi
Copy link
Owner

No, definitely not. GREP_COLOR and GREP_COLORS is for grep, not for ripgrep. It's IMO not a good idea to be respecting other tool's environment variables.

Moreover, ripgrep very intentionally doesn't expose a way to set arbitrary ANSI escape codes. Instead, you specify the styling you want and ripgrep translates that to ANSI escapes.

I guess I'd be open to adding a "blink" style... Then you could still get the styling you want at least.

@ClaireCJS
Copy link
Author

No, definitely not. GREP_COLOR and GREP_COLORS is for grep, not for ripgrep. It's IMO not a good idea to be respecting other tool's environment variables.

Moreover, ripgrep very intentionally doesn't expose a way to set arbitrary ANSI escape codes. Instead, you specify the styling you want and ripgrep translates that to ANSI escapes.

I guess I'd be open to adding a "blink" style... Then you could still get the styling you want at least.

That would indeed be nice. All the visual ANSI codes are implemented really well in Windows Terminal. Italics, underline, double-underline would be great.

but blink would be greatest! :) Thanks!!

image

@BurntSushi
Copy link
Owner

Italics and underline are already supported by ripgrep.

I probably won't work on this myself, but PRs are welcome.

@BurntSushi BurntSushi changed the title Can we respect the GREP_COLOR and GREP_COLORS environment variables add blink style support Nov 11, 2024
@BurntSushi BurntSushi added enhancement An enhancement to the functionality of the software. help wanted Others are encouraged to work on this issue. labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to the functionality of the software. help wanted Others are encouraged to work on this issue.
Projects
None yet
Development

No branches or pull requests

2 participants