5

While trying to compile using a C/C++ file using cc/c++ commands, I find that it is no longer possible for me to use Tab key for bash-completion.

I could do the same before 12.10. Also, when compiling with gcc and g++, bash-completion works fine.

2 Answers 2

3

What you are seeing is a bug in bash-completion.

Luckly there's a workaround: you can open /usr/share/bash-completion/completions/cc, find the following:

complete -F _gcc gcc g++ g77 gcj gpc &&
{
    cc  --version 2>/dev/null | grep -q GCC && complete -F _gcc cc  || :
    c++ --version 2>/dev/null | grep -q GCC && complete -F _gcc c++ || :
}

and replace it with the following:

complete -F _gcc gcc g++ g77 gcj gpc cc c++
2

I found a really simple and easy way to do it :

open .bashrc file

$ gedit ~/.bashrc

and add the following lines :

complete -f cc
complete -f c++

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .