问题
I'm attempting to set completion-ignore-case on
in my ~/.inputrc
, but the option seems to be ignored. When I hit tab, only case-sensitive matches are shown.
Here's my ~/.inputrc
:
# Bash input configuration
set completion-ignore-case on #Enable case-insensitive tab-complete
"\e[A": history-search-backward #Press up or down arrow to search through shell history on what you've already typed
"\e[B": history-search-forward
#"\e[1;9C": forward-word #alt-left/right to move the cursor by words
#"\e[1;9D": backward-word #I prefer to enable this in iTerm settings so it works no matter where I'm ssh'd to.
Oddly enough, the history-search-backward
and -forward
settings do work, so ~/.inputrc
is getting read, but completion-ignore-case
is getting ignored somehow.
Running bind "set completion-ignore-case on"
yields the expected behavior. I also tried set
-ing other variables in ~/.inputrc
and they also worked fine.
I'm running MacOS 10.12.4 and bash 4.4.12(1)-release (installed via homebrew).
回答1:
Try to remove the comment. This seems to make it work for me.
# Bash input configuration
set completion-ignore-case on
"\e[A": history-search-backward #Press up or down arrow to search through shell history on what you've already typed
"\e[B": history-search-forward
#"\e[1;9C": forward-word #alt-left/right to move the cursor by words
#"\e[1;9D": backward-word #I prefer to enable this in iTerm settings so it works no matter where I'm ssh'd to.
来源:https://stackoverflow.com/questions/43102223/set-completion-ignore-case-on-ignored-in-inputrc