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: Thu, 23 Mar 2023 09:09:14 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/22/23 4:33 PM, Koichi Murase wrote:


Do you think calling `compgen', which
leaves the state of `compopt -o filenames', etc., outside the bindable
function `compete' would affect any behaviors?

That's more or less the question. It's not that compgen leaves modified
readline state outside a call to complete -- each call to completion
reinitializes the completion state -- but that it affects subsequent
treatment of the generated completions. My position is that if you use
compgen in the same shell instance where you're attempting completion,
you want those changed behaviors to affect how readline treats the
generated completions.

One possible approach is to detect when compgen is called outside a
readline completion context and restore the readline variables it modifies
in that case.

--
``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]