With bash-completion-1.3-r2, completion works after "sudo," e.g. sudo <TAB><TAB> will suggest all commands available. Similarly, "sudo emerge --sy<TAB>" will complete to "sudo emerge --sync" With bash-completion-2.1-r2, there is no command completion after "sudo," e.g. sudo <TAB><TAB> will suggest all files in the current directory. Attempting "sudo emerge --sy<TAB>" will neither complete nor suggest anything. Reproducible: Always Steps to reproduce: 1. Type "sudo emerge --sy<TAB> Actual Result: No completion occurs Expected Result: Completion to "sudo emerge --sync"
I'm seeing something similar, but I think it's specific to "emerge", not "sudo" (in my case, anyhow). If I do "sudo docker t<tab>", I get completions, but emerge offers nothing no matter the arguments. On top of that, plain "emerge app-<tab>" pulls up nothing, which makes me think this is a gentoo-bashcomp issue, not necessarily a "sudo" issue. I'm on app-shells/bash-completion-2.1-r2 (and app-shells/gentoo-bashcomp-20121024). Perhaps the bump mgorny did for gentoo-bashcomp-20140911 to add "proper bash-completion autoloading support" is what's missing? :) I've verified that installing app-shells/gentoo-bashcomp-20140911 does work as expected here. (and thus, this bug becomes a justification for bug 531178)
It seems to work for me with 2.7. Feel free to reopen if you can still reproduce the problem.