If a completion function generates multiple matches that share a prefix (or
are even identical) and contain some invalid characters, these characters
are not treated as being part of the shared prefix.

For example:

bind 'set completion-ignore-case off'
LC_ALL=en_US.UTF-8
complete -F f f

f() { COMPREPLY=($'a\200ax' $'a\200ay'); }
f [TAB]      # completes to "a" only
             # \200 part not highlighted in list of matches

f a�[TAB]    # completes to "a" only
             # \200 is removed from line

f() { COMPREPLY=($'a\200' $'a\200'); }
f [TAB]      # completes to "a" only
             # only one possible completion is (correctly) displayed


Or, if the filesystem supports such names:

touch a$'\200'{x,y}
cat a[TAB]
cat a�[TAB]

Turning on completion-ignore-case or setting LC_ALL=C makes all of the above
work as expected.

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to