0

Is there a way to have a COMPREPLY return colored output? I can get it to work when readline recognizes the output as a folder when I have bind "set colored-stats on", but I can't make my own colors.

I tried using

COMPREPLY[i]="\[\E[01;34m\]${COMPREPLY[i]}\[\E[0m\]"

and

COMPREPLY[i]=$(printf "%b%s%b" "\x01\E[01;34m\x02" "${COMPREPLY[i]}" "\x01\E[0m\x02")

but the first prints those characters literally and the second prints ^A^[[0m^B for all options. Removing the \[ \] wrappers makes every option be ^[[0m

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.