[Feature request] color=auto mode
Opened this issue · 1 comments
tkapias commented
I would like to include hl in aliases to provide an output like color=auto in some binutils which lack colors.
But, it needs to detect that the output is in a pipe or not in a terminal and disable the coloration.
Manualy, I do it like that:
hlauto () {
if [ -t 1 ]; then
hl $1
else
cat -
fi
}
alias df='df -Tha --total | hlauto --df'
It works great. The new alias df
ouput in color, but df | less
output without hl.
Would it be easy to include this feature in hl? Maybe like this?
alias df='df -Tha --total | color=auto hl --df'
mbornet-hl commented
Hello,
thank you for your suggestion, I've added this to my "to do" list, but I'm VERY busy at the moment.
I've just thought about it and I think I've found a simple way to do this.
But I need some time to implement and test it.
Regards,
Martial