[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: completion-prefix-display-length doesn't check for common prefix
From: |
Chet Ramey |
Subject: |
Re: completion-prefix-display-length doesn't check for common prefix |
Date: |
Sun, 24 Apr 2016 19:29:18 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 |
On 4/24/16 3:36 PM, Grisha Levit wrote:
> On Fri, Apr 22, 2016 at 3:23 PM, Chet Ramey chet.ramey@case.edu
> <http://mailto:chet.ramey@case.edu> wrote:
>
> Bash-4.4 doesn’t do this.
>
> I was testing this with the latest devel version.
>
> |$ echo$BASH_VERSION4.4.0(2)-rc1$ cat .inputrc set
> completion-prefix-display-length 2$ f() { COMPREPLY=(aaaaa bbbbb ccccc); };
> complete -F f f $ f ddd<TAB><TAB>aaaaa bbbbb ccccc $ f dddd<TAB><TAB>...a
> ...b ...c |
I figured it out. Readline uses what the user typed as the common prefix
if there are multiple matches that don't share a prefix at all. It's been
like that for many years; I'm not going to change it before bash-4.4. The
common prefix (and its length) is what is used to determine whether or not
the prefix display length code is active.
I'll look at changing this after bash-4.4 is released. That's essentially
the cause of all the strange behavior, which is fairly rare.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/