On 12/11/11 3:41 PM, Raphaël Droz wrote:
> Example:
> $ var=$(id) foo <tab>
> completes with completion matches from id(1)
> 
> This is problematic for cases like:
> LD_LIBRARY_PATH=$(find ...) cmd --<tab>
> where options are those from find(1).
> 
> I didn't looked deeper but I guess the faulty part is in
> _rl_find_completion_word() which, as its name suggest, *should* find the
> word to be completed instead of returning rl_point as-is (14 in the
> above case)

That's not the problem; that *is* the (empty) word to be completed.

The problem isn't with readline, it's with the code that identifies the
command name in the command to be completed for use by programmable
completion.  There are two problems: the code that identifies the start
of the command has to skip over command substitutions, and the code that
slices up the identified command string into words has to skip over
assignment statements when deciding which word is the command name.  The
next version of bash will be better at doing that.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to