如果我的~/.inputrc
中有以下行,那么我就不能再使用向上和向下箭头在IRB中导航历史记录:
# Incremental searching with Up and Down. Type 'ssh <up>' to get the last 'ssh' command you used
"e[A": history-search-backward
"e[B": history-search-forward
有没有办法让它工作?这以前适用于 Ruby 2.6.x,所以我认为这与 2.7 中的 reline 实现有关
我找到了这个解决方法:
$if Ruby
$else
"e[A": history-search-backward
"e[B": history-search-forward
$endif
我根据@anothermh的评论修复了这个问题
使用单引号而不是双引号。所以像这样:
'e[A': history-search-backward
'e[B': history-search-forward