bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Save more readline state when running compgen


From: Chet Ramey
Subject: Re: [PATCH] Save more readline state when running compgen
Date: Tue, 21 Mar 2023 15:47:48 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 3/19/23 10:08 PM, Grisha Levit wrote:
Completion state is not fully restored after invoking `compgen' within
a competition function.

Normally, if a compspec does not specifically include one of the
options that triggers filename completion, the generated completions
are not treated as filenames:

$ complete -W '/tmp /var' cmd
$ cmd /[TAB]
/tmp /var

However, if a completion function is invoked, and that function
happens to call `compgen' with one of the options that triggers
filename completion, the generated completions _are_ treated as
filenames (i.e. get quoted, have `/' appended to directories, etc.)

OK, say you did in fact run compgen in the foreground -- very unusual
because it's awkward to capture the possible completions that way -- to
generate completions. Why wouldn't you want them treated the way compgen
generated them?

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]