Bash 使用pgUp和pgDn进行反向搜索

Bash 使用pgUp和pgDn进行反向搜索,bash,terminal,readline,Bash,Terminal,Readline,我在使用pgUp和pgDn自动完成历史记录中的搜索时遇到了一个奇怪的问题 我在gnome终端中使用bash 类型: 实际产量: vim fil~ pgUp和pgDn都在终端上打印~字符,而不是搜索历史记录 我想我的/etc/inputrc中有相关的行,但它们似乎没有帮助。有人能告诉我我做错了什么吗 这是我的inputrc,如果有人需要它: # do not bell on tab-completion #set bell-style none set meta-flag on set inp

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

我在gnome终端中使用bash

类型:

实际产量:

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
# 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
set show-all-if-ambiguous off
set show-all-if-unmodified on
set completion-ignore-case on
cat >> ~/.inputrc

"\e[5~": history-search-backward
"\e[6~": history-search-forward