Following is what i would like to have.When the tab completion is ambiguous, and bash prints the list of possibilities. I would like it to colour the next character I should press inside every word in the list.Following is what i have done so far.In my .bashrc i have defined the following functionand have called the complete command_colourunique() {    local word=${COMP_WORDS[COMP_CWORD]}    COMPREPLY=($(compgen -f -- ${word}))    if [[ $word ]] && [[ ${#COMPREPLY[@]} -gt 1 ]]; then        local  w        local  i=0        for ((i=0;i<${#COMPREPLY[@]};i++)) ; do            w=${COMPREPLY[$i]}            n=${#word}            COMPREPLY[$i]=${w:0:n}\033[91m${w:n:1}\033[0m${w:$((n+1))}        done    fi}complete -D -F _colouruniqueBut it is not working...When i typels D[TAB]It autocompletes as ls D\033[91mInstead of listing the possibilities Documents, Desktop etc.What could be going wrong here?Or is there some other direct way to accomplish this?UPDATE 1:I think i understand what is happening here. Since i add \033[91m to every word in COMPREPLY, bash sees this part is common to all, and autocompletes that common term into the command prompt itself. (instead of simply printing the list)So I don't think this method of editing COMPREPLY array is the way to do it.Is there any other method?UPDATE 2:To preserve the uniqness, i tried to add a $i and \b in the string.COMPREPLY[$i]=${w:0:n}$i\b\033[91m${w:n:1}\033[0m${w:$((n+1))}Now it prints the possible tab completions as following.D0\b\033[91mo\033[0mwnloads  D1\b\033[91me\033[0msktopWhich means, the list is printed as such. There is no evaluation of \b or \033[91m characters. :-( UPDATE 3:Since the replies looks like, there is no way to accomplish what i want in bash (unless i shift to zsh). I decided to settle for another option. I will try to append the next unique key stroke to end of every word, so that it stands out.Following is the code so far.SanitiseString () {    local String=$1    local j    for j in \\ \! \@ \# \$ \% \^ \& \* \( \) \+ \{ \[ \] \} \| \; \: \ \' \, \? \ ; do        String=${String//$j/\\$j}    done    echo $String}_colourunique() {    saveIFS=$IFS    IFS=$'\n'                                       local word=${COMP_WORDS[COMP_CWORD]}    COMPREPLY=($(compgen -f -- ${word}))    if [[ $word ]] ; then        local  w        local  i=0        for ((i=0;i<${#COMPREPLY[@]};i++)) ; do            w=${COMPREPLY[$i]}            n=${#word}            w=$(SanitiseString $w)            if  [[ ${#COMPREPLY[@]} -gt 1 ]] ; then                COMPREPLY[$i]=$w :${w:n:1}            else                COMPREPLY[$i]=$w            fi        done    fi    IFS=$saveIFS}complete -D -F _colouruniqueThis will print the options with the next unique keystroke separated by :But the code still has two irritating issues. which i have to solveIt no longer appends the / at the end of autocompleted directoriesIt no longer does the intelligent spacing after the auto complete.Any suggestions?
how to edit and color bash's tab completion list
bash;colors;autocomplete