Closed mbechto closed 1 year ago
In the diff
command above, if you change --color
to --color=always
does this fix the problem?
I see colored output with either of these commands (-s
is equivalent to /bin/bash -c
):
rust-parallel /bin/bash -c ::: "diff --color=always <(echo hi) <(echo there)"
rust-parallel -s ::: "diff --color=always <(echo hi) <(echo there)"
The default behavior of diff --color
is to autodetect if the output is a terminal or not, and to only output colors if a terminal is detected. I suspect the pipes used by rust-parallel do not pass this "are we using a terminal" check and so this autodetection does not work.
But for me it looks like using --color=always
to force use of color works.
From the diff man page: https://man7.org/linux/man-pages/man1/diff.1.html
--color[=WHEN]
color output; WHEN is 'never', 'always', or 'auto'; plain
--color means --color='auto'
Thanks!
In the diff command above, if you change --color to --color=always does this fix the problem?
Yes, indeed it does. Sorry for the confusion, I forgot how the --color
parameter works.
(-s is equivalent to /bin/bash -c):
Good to know!
Anyway, thanks for the help (and this great project!) 🙂
Thank you @mbechto !
I appreciate your question and feedback, let me know if you run into other issues. 🙂
@mbechto you might find this example useful based on your question: https://github.com/aaronriekenberg/rust-parallel/wiki/Examples#running-diff-on-all-files-in-2-directories
thanks! 🙂
Steps to Reproduce
Run the following with
rust-parallel
1.6.2:Expected Behaviour
The command output should contain colored text, since running the same command in the shell yields colored output.
Actual Behaviour
The command output does not contain colors: