OK, I can see what's happening here - and I think it's a bug (although I
might be persuaded it's a preference).
/etc/bash_completion uses:
complete -F _mount $default $dirnames mount
where _mount is a function that returns a list of the mount directories
matching the name being completed; so
because I have one and only one /media mount in fstab (/media/cdrom0) it
returns /media/cdrom0 as the one
and only completion option.
$dirnames is set to -o dirnames
This causes completion to complete directories only if the -F function
returns an empty list.
Newer bash has -o plusdirs which *adds* the list from the -F to the list, which
IMHO is the right behaviour;
the code at the top of /etc/bash_completion detects that bash is new enough and
sets a $plusdirs
that we could use instead of $dirnames.
$plusdirs is rarely used (in a few of the /etc/bash_completion.d
scripts)
IMHO the right behaviour here is to use -o plusdirs in most cases, either by
just assuming we're on a modern bash,
or by having a variable (e.g. $newestdircomp) that is set to '-o plusdirs' on
newer bashes and '-o dirnames' on older bashes.
Dave
--
directory for mount not completing
https://bugs.launchpad.net/bugs/395279
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs