On 4/24/16 3:36 PM, Grisha Levit wrote: > On Fri, Apr 22, 2016 at 3:23 PM, Chet Ramey chet.ra...@case.edu > <http://mailto:chet.ra...@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 c...@case.edu http://cnswww.cns.cwru.edu/~chet/