helpThe GNU Bourne-Again SHell - Support: sr #110063, bash completion recognizes command...


sr #110063: bash completion recognizes command start after { when used as brace expansion

Submitter:  Bob Weinand <bwoebi>
Submitted:  Fri 18 Oct 2019 06:05:33 AM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Tue 14 Jan 2020 07:15:32 PM UTC, comment #1: 

Thanks for the report. You are correct; this needs to check whether the open brace would be parsed as a reserved word.

Chet Ramey <chet>
Project Administrator
Fri 18 Oct 2019 06:05:33 AM UTC, original submission:  

Given a trivial completion function (as a simple reproduce case):

function foo() {
        echo $COMP_WORDS
complete -F foo foo

Try typing: foo a{1,2} bar<tab>

Expected is that after pressing tab, it outputs "bar".

Instead, it will find_cmd_start() at the offset of "1,2}", not find the assigned completion and attempt default completions instead.

The issue is that { is here recognized as a command separator, by itself, while it only really is a command separator if at start of line (excluding whitespace) and after other command separators.
This needs special handling.

Bob Weinand <bwoebi>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by bwoebi (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-14 chet StatusNone Done

    Back to the top

    Powered by Savane 3.10