bash - ~/.inputrc 中忽略 "set completion-ignore-case on "

标签 bash macos readline

我试图在我的 ~/.inputrc 中设置 completion-ignore-case on,但该选项似乎被忽略了。当我点击 Tab 键时,只显示区分大小写的匹配项。

这是我的 ~/.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.

奇怪的是,history-search-backward-forward 设置确实起作用,所以~/.inputrc 正在 被读取,但是 completion-ignore-case 不知何故被忽略了。

运行 bind "set completion-ignore-case on" 会产生预期的行为。我还尝试了 set - 在 ~/.inputrc 中设置其他变量,它们也工作正常。

我正在运行 MacOS 10.12.4 和 bash 4.4.12(1)-release(通过自制软件安装)。

最佳答案

尝试删除评论。这似乎对我有用。

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

关于bash - ~/.inputrc 中忽略 "set completion-ignore-case on ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43102223/

相关文章:

macos - Qt Creator 调试器非常慢

python读取文件,根据条件抓取行

linux - 延迟不阻止 Bash 函数同时执行

java - 在Linux headless 机器中修改文件时触发java jar文件

macos - 将授权服务与 NSTask 结合使用

java - 在 Java 中将字符串分成多个部分的安全方法是什么?

java - 如何使用 Eclipse 向 BufferedReader 的 readLine() 方法提供 null

linux - BASH Loop 同时运行命令

bash - IF 语句与逻辑运算符未按预期工作

适用于 Mac 的 Oracle 图形用户界面