Experienced with bash-5.1_p16-r2, bash-completion-2.11, and util-linux-2.38.1. I tried to tab complete the shell in 'su - portage -s /bin/b<TAB>' and it exited displaying 'chsh --help' Reproducible: Always Steps to Reproduce: 1. su - portage -s /bin/b<TAB> Actual Results: chsh --help printed Expected Results: tab complete the shell
Since then, the current completion file for su is installed by util-linux: > sys-apps/util-linux: /usr/share/bash-completion/completions/su I suspect the fix to completion file will be similar to https://github.com/scop/bash-completion/commit/86574164df810ecbd53ae841c15b38e5b06dc068 Or if we want to limit to only existing shells, improve my oneline: > while read line; do [[ -e "${line}" ]] && echo "${line}"; done < /etc/shells