-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ripgrep since 0.3.0 produces terrible output in non-color xterms #255
Comments
Does I don't really get why you are seeing blinking or strike through text. The intended behavior is to use ANSI escape sequences to color certain aspects of the output. If this is doing something else, then I'd like to fix it, but as it stands i don't understand your environment enough to reproduce the issue. Could you elaborate more? I would like to further avoid discussion about default colors in this issue. If you want to open a separate issue then that's okay. The short story is that you should be able to change colors/styles using the |
By the way, I use black on white and I use the default color scheme. |
|
Have you looked at |
(If I don't clear the existing color settings first and just try to set everything bold, text still blinks and so on.) |
I was able to reproduce this problem using I wasn't familiar with
I'm not sure what you're actually expecting to happen here. ripgrep doesn't know that you've disabled ANSI color escape sequences, and I don't know why Given that you can actually fix this with sufficient application of the |
I did some tests and things are interesting here. Rather than speculate, I will tell you what I've determined:
If I'm reading the raw output correctly, the 0.2.9 control sequence for eg file names are CSI 32 m CSI 1 m. In the same situation, 0.3.1 sends CSI m CSI 3 8 ; 5 ; 1 0 m. The xterm page doesn't document the latter, but it appears to be ANSI color codes used to directly pick the high-intensity green. Ripgrep 0.3.1 appears to use high-intensity colors for all of its highlighting, and presumably a non-color xterm interprets these as 'they said high intensity so I'll make the text blink'. (Using |
I wouldn't expect it to. If
Hmm, I'm not necessarily seeing the same thing. The intensity doesn't appear related to the blinking. For example, if you use It looks like
A big part of ripgrep 0.3.0 was a complete overhaul of how colors are handled. In particular, we switched away from an error prone process of reading a |
It does seem that way. I've tried to look at the xterm code in order to figure out how it behaves, but I can't follow the code well enough to do that; there is a lot of levels of magic involved in the handling of the |
All right, I think I'm going to close this for a couple reasons:
In any case, thanks so much for the report and the follow up info. If the underlying issue spreads to non-niche use cases, then perhaps we will be forced to fix it for reals. :-) |
If you used old versions of ripgrep (0.3.0) in an xterm that had color disabled, they simply bolded some portions of the output (it looks like file names, line numbers, and matching text). Versions from 0.3.0 onwards do truly unreadable things in this environment. Everything that used to be bolded now blinks, and matching text has a
strikethrough it. Given the blinking, the result is not in the least bit usable.Can the old behavior be restored on non-color xterms? Better yet, can we also get an option that always does this (even when color is available)? Even in environments with colors I would often prefer not to use them and would rather have things just come out as bold.
(In theory color can make things more readable. In practice automatically chosen highlight colors don't always go with certain choices of foreground and background colors. I use black text on white background, which clashes with most color schemes; they often seem designed for white on black.)
The text was updated successfully, but these errors were encountered: