kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

Do not display colors in log() when piping output #208

Closed jedahan closed 3 years ago

jedahan commented 3 years ago

I wrote a completion for kiss, that parses the output of kiss and kiss help-ext. This prints output to stdout when in a pipe, and removes the colors. It should make wrapping kiss a lot easier.

see the completions at https://github.com/jedahan/kiss-repo/blob/main/kiss-zsh-completions/files/_kiss

cemkeylan commented 3 years ago

This can be handled by changing this one line https://github.com/kisslinux/kiss/blob/f77e08bd1b5525146a6e78d233705eca3da2f91d/kiss#L1619

[ "$KISS_COLOR" = 0 ] || ! [ -t 1 ] || lcol='\033[1;33m' lcol2='\033[1;34m' lclr='\033[m'