dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
21.43k stars 362 forks source link

🐛 --paging=auto still pages even when piping to non-TTY #1515

Open PatrickF1 opened 11 months ago

PatrickF1 commented 11 months ago

Description

Output of

ls | delta --paging=auto --pager="less --version" | cat

is less's version output.

But the output is normal if the command is

ls | delta --paging=never --pager="less --version" | cat

Expectation

--paging=auto should not page if the output is not a TTY. This is very standard for many tools, e.g. grep --color=auto does not color when non-TTY, same for fd, git does not use pager when non-TTY. I understand the auto probably factors in input line count, but I think it should factor the output as well. Or at least describe explicitly what it does in docs. Because the current state is very misleading and the only implicit indication of what auto really does was https://dandavison.github.io/delta/environment-variables.html#pager-environment-variables.

Anyway, thanks for making delta! Despite this small problem, it works very well and I love it!