You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that ripgrep could insert CR characters into its output on Linux, which I didn't expect.
I took a quick look out of curiosity, and saw that the same LineTerminator is being used for searching and for printing, which I thought could be an oversight, so I figured I'd report it just in case. I don't think this has a real impact on anything though, so feel free to simply close this issue if that's ok for you.
Even on Linux, a CRLF end-of-line (0d 0a) is emitted when --crlf is used. I used --count to force write_line_term() to be called, but other flags such as --pretty work just as well.
What is the expected behavior?
I expected the outputs of the two commands to be the same.
The text was updated successfully, but these errors were encountered:
Please tick this box to confirm you have reviewed the above.
What version of ripgrep are you using?
ripgrep 14.1.0
features:-simd-accel,+pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 10.43 is available (JIT is available)
How did you install ripgrep?
cargo install ripgrep --features pcre2
What operating system are you using ripgrep on?
Ubuntu 22.04.4 LTS on WSL
Describe your bug.
I noticed that ripgrep could insert CR characters into its output on Linux, which I didn't expect.
I took a quick look out of curiosity, and saw that the same
LineTerminator
is being used for searching and for printing, which I thought could be an oversight, so I figured I'd report it just in case. I don't think this has a real impact on anything though, so feel free to simply close this issue if that's ok for you.I tracked down the culprit to this function:
ripgrep/crates/printer/src/standard.rs
Lines 1493 to 1495 in bb8601b
What are the steps to reproduce the behavior?
What is the actual behavior?
The output changes between
--crlf
and--no-crlf
.Even on Linux, a CRLF end-of-line (
0d 0a
) is emitted when--crlf
is used. I used--count
to forcewrite_line_term()
to be called, but other flags such as--pretty
work just as well.What is the expected behavior?
I expected the outputs of the two commands to be the same.
The text was updated successfully, but these errors were encountered: