[Bash-completion-devel] Towards dynamic completion loading
Ville Skyttä
ville.skytta at iki.fi
Sun Oct 23 07:41:28 UTC 2011
On 10/23/2011 03:08 AM, Igor Murzov wrote:
> Found a regression. Completing shell variables names no longer works.
> $ echo $B<TAB>
> gives me
> $ echo \$BASH
> for "dynamic-loading" branch. Further hits of tab button give no effect.
I don't know if there's much/anything we can do about this.
_completion_loader needs to define *some* completion for the current
command, otherwise there will be no completion for it at all. So it's
the fallback definition at end of _completion_loader which breaks the
variable completion; more specifically the -f in it. And removing the
-f is not really an option - that'd break filename completion which is
what we want for commands we don't have completions for.
In my opinion this is kind of a bash bug - if a completion loader
function doesn't define anything for the current command, bash should
continue to use its default completion for it, not suppress completion
altogether (or perhaps make it controllable it with the return value of
the loader function, for example do it only if the return value is 0).
But then again, completing variable names doesn't really work in the
master branch either for commands we install completions for.
More information about the Bash-completion-devel
mailing list