[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG][bash][auto completion] if COMPREPLY contents ":" auto completi
Re: [BUG][bash][auto completion] if COMPREPLY contents ":" auto completion doesn't work properly
Tue, 26 Sep 2006 16:07:23 -0400
> Chet Ramey <address@hidden> wrote:
> > Vasily Tarasov wrote:
> >> I suppose I've found a bug;
> > I need to make this part of the FAQ. The `:' is special to readline: it
> > splits words for the word completion code.
> That explains some of what's going on in this case, but not all. For
> the first tab, shouldn't the text filled in by completion be "qwe\:o"
> instead of "qwe:o", since it includes a COMP_WORDBREAKS character?
> That's how filename completion behaves, so I'd expect the same
> behavior here. Is the completion function responsible for adding the
> backslash, or should bash do it?
The backslash addition is a feature of filename completion, and bash's
default word completion. There isn't a really good way to have such
quotes stripped before handing the word to the completion function, nor
is there a specific option to have filename-like quoting applied to the
result (though the completion function can always add the backslash).
> Also, after two tabs, we have "qwe:qwe:o", but further tabs don't add
> any more "qwe:"'s for some reason I don't understand.
Because the colon is still a word break character, and readline passes `o'
to the completion function as the partial word to be completed.
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU address@hidden http://tiswww.tis.case.edu/~chet/