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 c...@case.edu http://tiswww.cwru.edu/~chet/