[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] completion matches with invalid characters not treated as

From: Grisha Levit
Subject: [Bug-readline] completion matches with invalid characters not treated as having shared prefix
Date: Sat, 28 Sep 2019 03:29:59 -0400

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'
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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]