When delta receives empty stdin (zero bytes), it emits \x1b[00;39m (ANSI reset + default foreground color), which renders as a visible blank line in the terminal.
Reproducer
# Terminal: phantom blank line appears
printf '' | delta
# Proof it's an ANSI escape, not a newline
printf '' | delta | cat -v
# ^[[00;39m
# Byte count confirms it's the escape sequence, not a newline
printf '' | delta | wc -c
# 10
# Expected: no output at all (like cat)
printf '' | cat
# (no output)
Contrast with 2-arg mode
2-arg mode with empty files produces clean output (no extra line):
delta /dev/null /dev/null
# (no output)
Impact
When delta is used as a diff colorizer in a pipeline, any upstream command that produces only stderr (no stdout) feeds empty stdin to delta. The resulting ANSI reset renders as a phantom blank line between the error message and the next prompt.
Example — diff invoked with no file arguments:
diff /dev/null 2>/dev/null | delta # prints a blank line
Expected behavior
When stdin is empty (zero bytes), delta should produce no output — same as cat on empty stdin.
Environment
- delta version: 0.19.2
- OS: Manjaro Linux (kernel 7.0.3-1, x86_64)
- Terminal: kitty 0.42.1
When delta receives empty stdin (zero bytes), it emits
\x1b[00;39m(ANSI reset + default foreground color), which renders as a visible blank line in the terminal.Reproducer
Contrast with 2-arg mode
2-arg mode with empty files produces clean output (no extra line):
delta /dev/null /dev/null # (no output)Impact
When delta is used as a diff colorizer in a pipeline, any upstream command that produces only stderr (no stdout) feeds empty stdin to delta. The resulting ANSI reset renders as a phantom blank line between the error message and the next prompt.
Example —
diffinvoked with no file arguments:Expected behavior
When stdin is empty (zero bytes), delta should produce no output — same as
caton empty stdin.(You can use
git --no-pagerto produce the raw text output.)Not a git diff issue — this reproduces with
printf '' | deltaand no git involved.The output is a single blank line — a screenshot wouldn't add information beyond
cat -vabove.Environment