【问题标题】:"set completion-ignore-case on " ignored in ~/.inputrc"set completion-ignore-case on " 在 ~/.inputrc 中被忽略
【发布时间】:2017-08-23 10:55:45
【问题描述】:

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

这是我的~/.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-ing ~/.inputrc 中的其他变量,它们也运行良好。

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

【问题讨论】:

    标签: bash macos readline


    【解决方案1】:

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

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

    【讨论】:

    • facepalm 我不敢相信这是问题所在。事实证明,您不能将 cmets 与 inputrc 中的命令放在同一行。
    猜你喜欢
    • 2021-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-04
    • 2012-05-10
    • 1970-01-01
    • 2021-01-26
    相关资源
    最近更新 更多