Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 899186

Summary: sys-apps/util-linux: trying to invoke bash completion on "su - -s" outputs "chsh --help"
Product: Gentoo Linux Reporter: ephemer0l <om>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: normal CC: arthurzam, gentoo, shell-tools
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description ephemer0l 2023-03-03 20:23:31 UTC
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
Comment 1 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2024-05-03 10:37:41 UTC
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