🐛 input redirection doesn't work with standalone delta command
I've been facing the exact same issue as described in #1219. I left a comment there describing my actual problem; perhaps reopening the old issue would be more relevant than continuing here.
TL;DR delta <(echo abc) <(echo abd) exits 1 without displaying the diff. It also returns 1 when both outputs are the same.
What is the ouput of printf "%s %s\n" <(echo a) <(echo b)? It should print two /dev/fd/.. paths (which delta would then try to hand to diff). Since you mentioned Windows, maybe the /dev/fd/.. doesn't work there, what does cat <(echo works) print, and is diff installed?
I tried again on my NixOS machine, it works fine here: exits 0 on similar outputs, exits 1 printing the diff when there is one. This is with delta 0.18.2 from latest nixpkgs.
I'll try again tomorrow on my windows machine to provide more info on the problem.
From memory, when I tried, I had correct behaviour when using diff instead of delta, so I expect that testing with printf '%s %s\n' would not provide much more relevant info.
It is just as I remembered, works fine with diff, but delta exits 1 showing no diff no matter the input.
(0)$ PS1='($?)\$ '
(0)$ printf '%s %s\n' <(echo abc) <(echo abc)
/dev/fd/63 /dev/fd/62
(0)$ diff <(echo abc) <(echo abc)
(0)$ diff <(echo abc) <(echo abd)
1c1
< abc
---
> abd
(1)$ delta <(echo abc) <(echo abc)
(1)$ delta <(echo abc) <(echo abd)
(1)$
(1)$ delta --version
delta 0.18.2
(0)$ $SHELL --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
(0)$
(on win11)
Last time I looked at Windows and the (heroically) ported Unixy-tooling I noticed that bash, diff, printf etc. are built with MinGW / MSYS extensions. This makes C: become available as /c/, /dev/ and /proc also show up on that "virtual" root level and include file descriptors.
Bash creates a new fd on <(echo abc), inheriting seems to work in a pure-MinGW env. delta however is built without these, and I see on Windows HANDLE_FLAG_INHERIT would have to be set -- assuming this is the used mechanism. Maybe this is getting lost in the bash -> delta -> diff call chain. If you have some non-msys way to create a program, say python, you could check by having it call diff via python.exe <(echo abc) <(echo abd), then start the subprocess with the two arguments. Python has os.set_inheritable(), maybe that also works on Windows.