Recently i face inconvenient when using bash auto complete with ignore case.
Let's say i have this directories:
[xiaobai@xiaobai test]$ l
total 20K
3407873 drwx------. 60 xiaobai xiaobai 4.0K May 25 17:17 ../
3409017 drwxrwxr-x. 2 xiaobai xiaobai 4.0K May 25 17:35 hello/
3681826 drwxrwxr-x. 2 xiaobai xiaobai 4.0K May 25 17:55 Hello_STACKOVERFLOW/
3681837 drwxrwxr-x. 2 xiaobai xiaobai 4.0K May 25 17:55 Hello_StackOverflow/
3412549 drwxrwxr-x. 5 xiaobai xiaobai 4.0K May 25 17:56 ./
[xiaobai@xiaobai test]$
then cd h[Tab]:
[xiaobai@xiaobai test]$ cd h #and press [Tab]
hello/ Hello_StackOverflow/ Hello_STACKOVERFLOW/
[xiaobai@xiaobai test]$ cd hello #auto generate
You will notice the new command prompt come with auto complete 'hello' while there's alternative 'Hello' exist. But here i have no problem because i can either insert / OR press [Enter] to go inside hello/. Or i can insert underscore _ and press [Tab] to go further Hello_*:
[xiaobai@xiaobai test]$ cd hello_ #and press [Tab]
Hello_StackOverflow/ Hello_STACKOVERFLOW/
[xiaobai@xiaobai test]$ cd Hello_StackOverflow #auto generate
Now the problem become obvious, what if my target was 'Hello_STACKOVERFLOW/' ? I have to press Back Space to delete 'tackOverflow' and then insert T+[Tab] to reach my target.
What i want is:
[xiaobai@xiaobai test]$ cd hello_ #and press [Tab]
Hello_StackOverflow/ Hello_STACKOVERFLOW/
[xiaobai@xiaobai test]$ cd Hello_S #without 'tackOverflow', so i just have to type T+[Tab] without redundant erase step.
Of course it wouldn't have such problem if completion-ignore-case off on my inputrc file. But i like to ignore case but avoid auto complete when ambiguous. Is it possible to do that ?
matcher-list
).