为什么“bind ~/.inputrc”会导致我的右斜杠键(“/”)在我重新登录之前被禁用?

为什么“bind ~/.inputrc”会导致我的右斜杠键(“/”)在我重新登录之前被禁用?

下面是我的.inputrc文件。为什么在调用 后bind ~/.inputrc,我的右斜杠键被禁用,直到我注销并再次登录?

# Key-bindings for the command-line editor.

# Ask before displaying >50 items
# Since $WINDIR $PATH var can be in $PATH, this could list
# all window exectables in C:\WINDOWS
set completion-query-items 50

# Ignore case for the command-line-completion functionality
# on:  default to a Windows style console
# off: default to a *nix style console
set completion-ignore-case on

# none, visible or audible
set bell-style audible

# disable/enable 8bit input
set meta-flag on
set input-meta on
set output-meta off
set convert-meta on

# visible-stats
# Append a mark according to the file type in a listing
set visible-stats off
set mark-directories on

# Show all instead of beeping first
set show-all-if-ambiguous on

"\e[1~": beginning-of-line       #HOME
"\e[4~": end-of-line             #END
"\e[A":history-search-backward   #UP
"\e[B":history-search-forward    #DOWN

答案1

因为bind ~/.inputrc是绑定键序列的命令,/home/aliteralmind/inputrc其中/home/aliteralmind是您的主目录。这会绑定/到未定义绑定的前缀键,因此按此/键后不会执行任何操作。

要从 bash 读取 readline 文件,请使用

bind -f ~/.inputrc

不过,这个特定的示例并不是很有用,因为~/.inputrc它是在 bash 启动时读取的。唯一的用途是在更改文件时加载新绑定(这不会删除已删除的绑定)。

相关内容