bash inputrc 将不会加载

bash inputrc 将不会加载

我创建了 ~/.inputrc 并且在 bash readline 中看不到它的任何效果。

$ bind -f ~/.inputrc不显示错误也不加载文件。

$INPUTRC 未设置,如果我export INPUTRC=~/.inputrc在 ~/.bashrc 中并重新启动 bash,则不会发生任何变化。

$ strace bash在验证读取发生的输出中搜索 inputrc :

openat(AT_FDCWD, "/home/me/.inputrc", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=1900, ...}) = 0
read(3, "# ~/.inputrc\n#\n# bash configurat"..., 1900) = 1900
close(3)                                = 0

我的 .inputrc 打开的输出$ bind -v | grep completion-ignore-case,但绑定显示它保持关闭状态:

设置完成忽略大小写关闭

的输出$ bind -p | grep -e C-q应该显示我的 .inputrc 重新定义了 control-q,但绑定显示:

“\Cq”:引用插入

我的输入文件:

# ~/.inputrc
#
# bash configuration file
# See readline(3readline) and `info rluserman' (readline llibrary) for more information.
#
# set VARIABLE VALUE
# KEY-NAME: "MACRO"
# KEY-NAME: COMMAND
#
# Note: Keystrokes like \015 or \C-m (return) may be part of MACRO
#
# \C-KEY = Control-KEY (KEY should be lower case)
# \M-KEY = Alternate-KEY (KEY should be lower case)
# \e = escape (sent by keyboard when using alternate key)
# \\ = backslash
# \" = double quote
# \' = single quote
# \a = altert bell
# \b = backspace
# \d = delete
# \f = form feed
# \n = newline (linux: line feed \x0A)
# \r = return
# \t = tab
# \v = vertical tab
# \ooo = 8 bit octal code
# \xHH = 8 bit hex codep
#
# $if
# $else
# $endif
# $include

###############
# stuff from /etc/inputrc
###############

# Be 8 bit clean.
set input-meta on
set output-meta on

# arrow key bindings
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char

# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line

# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert

# alternate mappings for "page up" and "page down" to search the history
# "\e[5~": history-search-backward
# "\e[6~": history-search-forward

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

$if term=rxvt
"\e[7~": beginning-of-line
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word

###############
# my stuff
###############

set colored-stats on
set completion-ignore-case on
set completion-prefix-display-length 3
set mark-symlinked-directories on
set show-all-if-ambiguous on
set show-all-if-unmodified on
set visible-stats on

# Convert line to $"(..)"
"\C-q": "\C-a\"$(\C-e)\"\C-a"

答案1

我的.inputrc文件包含一个$if但缺少一个$endif导致内容被忽略。

相关内容