使用pgUp和pgDn进行反向搜索

时间:2013-06-16 17:49:20

标签: bash terminal readline

我在使用pgUp和pgDn从历史记录中自动完成搜索时遇到了一个奇怪的问题。

我在gnome-terminal中使用bash。

型:

vim fil<pgUp>

预期产出:

vim filename

实际输出:

vim fil~

pgUp和pgDn都在终端上打印一个〜字符,而不是搜索历史记录。

我认为我的/ etc / inputrc中有相关的行,但它们似乎没有帮助。有人能告诉我这里我做错了什么吗?

这是我的inputrc应该有人需要它:

# do not bell on tab-completion
#set bell-style none

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

# Completed names which are symbolic links to
# directories have a slash appended.
set mark-symlinked-directories on

$if mode=emacs

# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# commented out keymappings for pgup/pgdown to reach begin/end of history
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
#"^[[5~": history-search-backward #these are the values read gives for pgUp, pgDn. They don't work either.
#"^[[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word

# for rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word

# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif

我的〜/ .inputrc是否相关。

set show-all-if-ambiguous off
set show-all-if-unmodified on
set completion-ignore-case on

1 个答案:

答案 0 :(得分:0)

ngTemplateOutlet