-
-
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
escape codes instead of color #1123
Comments
This seems like a bug in the console you're using, not ripgrep. Can you reproduce this in a standard Windows console? |
Something to do with this? |
Yes, the issue is only when using the winpty wrapper |
This does indeed look like a bug in winpty in that it simply cannot handle ANSI escape sequences. ripgrep uses them in this context because, on Windows, it will attempt to enable VT emulation, which is what makes ANSI escapes work in Windows 10. If enabling VT emulation is successful, then ripgrep will use ANSI escape sequences instead of using the normal Windows console APIs for colors. One possible work-around for this would be to expose an option of some kind to forcefully disable the use of VT emulation. Unfortunately, the plumbing to do this is probably non-trivial. Therefore, whether we add the work-around or not really depends on the severity of this bug. It's hard for me to estimate how severe this is. |
I'm not really able to qualify the severity. As you can see from above screenshots, piping a Windows applications output ( Maybe it would make sense to see why pt and ag don't exhibit the problem. |
I hinted at this with my work around above. My guess is that neither of those programs know how to use ANSI escape sequences on Windows and instead always interact with the Windows console APIs. I would suggest lobbying the winpty developers to get their thoughts on the nature of this bug. |
I'm going to close this under the assumption that this is a bug in winpty. |
What version of ripgrep are you using?
How did you install ripgrep?
Not installed just downloaded
What operating system are you using ripgrep on?
Windows 10
Describe your question, feature request, or bug.
ripgrep outputs escape sequences that are not interpreted as color codes by the terminal.
If this is a bug, what are the steps to reproduce the behavior?
If this is a bug, what is the actual behavior?
If this is a bug, what is the expected behavior?
Output color codes that the terminal understands
The text was updated successfully, but these errors were encountered: