[Bash-completion-devel] how to kill trailing space from alias completion ?

Ville Skyttä ville.skytta at iki.fi
Tue Sep 3 06:46:25 UTC 2013

On Mon, Sep 2, 2013 at 11:30 PM, Lachlan Deck <lachlan.deck at gmail.com> wrote:
> Hi there,
> I'm finding that when tab completing aliases that bash-completion keeps adding a trailing space -- which for directory aliases or exports is annoying.
> e.g.,
> export CATALINA_HOME=/path/to/tomcat

Hm, you mentioned aliases but I don't see anything alias related there
-- do you mean completing environment variables, like "ls
$CATALINA_HOME<TAB>" after the above?

> Has anyone got a fix for that?

I'm afraid it'd be a nontrivial change because variable completion
occurs so early in our _init_completion function that there's no
context there whether the variable is expected to be a file/dir one
(in which case not appending the trailing space but perhaps a slash
might be useful but this would need more thought) or not (in which
case not appending the space wouldn't be a good thing).

More information about the Bash-completion-devel mailing list