helpThe GNU Bourne-Again SHell - Support: sr #110603, Colon starting suggestions wrongly...

 
 

sr #110603: Colon starting suggestions wrongly completed

Submitter:  hasb
Submitted:  Mon 07 Feb 2022 02:40:24 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:
       

 

Mon 07 Feb 2022 04:39:26 AM UTC, comment #1: 

It looks like default value of variable COMP_WORDBREAKS is not compatible with completion containing colon char. https://unix.stackexchange.com/a/613246

It can be adjusted by

    COMP_WORDBREAKS=${COMP_WORDBREAKS/:/}

Please feel free to close this (as I cant find out how to close this by myself).

hasb
Mon 07 Feb 2022 02:40:24 AM UTC, original submission:  

With completion definition like

    complete -W ':bar :baz' foo

and command line looking like

    $ foo :

and pressing key <Tab>

Expected behavior: Command line changes to "$ foo :ba" as ":ba" as common prefix of all suggestions.

Actual behavior: Command line changes to "$ foo ::ba". The colon character is erroneously doubled. That prevents both further tab-completion and manual finishing of selected option.

Also:

with same completion definition

    complete -W ':bar :baz' foo

and command line like

    $ foo :b

and single press of key <Tab>

Expected behavior: Command line is changed to "$ foo :ba".

Actual behavior: Command line is not changed, bell sound is invoked.

Notes:
It works fine without the leading colons. "complete -W 'bar baz' foo" allows "$ foo b" to be completed to "$ foo ba".

Version:

  • Fedora 35

  # bash --version
  GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
  Copyright (C) 2020 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  # rpm -q bash
  bash-5.1.8-2.fc35.x86_64

  • Windows 10, msys64

  $ bash --version
  GNU bash, version 4.4.23(2)-release (x86_64-pc-msys)
  Copyright (C) 2016 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

hasb

 

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

Attach Files:
   
   
Comment:
   

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 (Updated the item)
  • -email is unavailable- added by hasb (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
    2022-02-10 chet StatusNone Done

    Back to the top


    Powered by Savane 3.9