🐛 CRLF line endings are stripped from diff
- Dominant language
- Rust
- Stars
- 32.2k
- Forks
- 572
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Description
I'm trying to show CRLF line endings in my diffs (on Linux, to quickly spot if someone committed a file with CRLF instead of LF). Less has the option `-u/--underline-special` to do just that, so I could just use that as pager for delta. However, delta _always_ seems to strip the carriage return byte from diffs, see:

Here is a hexdump of both diffs. You can see the CR-bytes (0x0d) are missing.

Even if delta strips the ANSI color escape codes (which is turned off here with `--raw`), it should never just delete any other character from the output. Let the pager decide to show those control chars or not.
Contributor guide
Research direction
Reproduce the issue with a CRLF-containing diff on Linux, using delta with --raw and a pager that displays control characters. Trace the diff-output processing to find where 0x0d is removed; done means the carriage return bytes reach the pager unchanged while ANSI handling still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100