无法通过 ssh 输入字母“e”

Zul*_*kis 59 ubuntu ssh terminal

现在,我在管理的 Ubuntu 14.04.2 LTS 服务器上遇到了一些非常非常奇怪的行为。

从 cygwin(mintty) 或 Linux 机器上的终端通过 ssh 连接到服务器,我无法输入字母 e

我已经完成了以下调试:

  • 字母e可以在远程服务器上的vim中输入
  • 该字母e可以在本地机器的终端中输入
  • $TERM 被设定为 xterm
  • $LANG$LANGUAGE$LC_ALL设置为de_DE.utf8
  • locale charmap 返回 UTF-8

现在,我完全不知道是什么导致了这种情况。

我会很高兴关于如何解决这个问题的一些建议。

Zul*_*kis 59

我的问题与can't type lower caseed e in amazon ec2 (Amazon Linux) 不同,但相似。

检查/etc/inputrc并没有发现任何异常后,我记得我确实在/etc/bash.bashrc. 不过,这已经存在了很长时间并且完美无缺。为什么现在会出问题?

我在检查时发现/etc/bash.bashrc

由于所有文件都是使用 ansible 管理的,因此也使用 ansible 插入了此命令:

- name: Up Arrow Command Search
  lineinfile: dest=/etc/bash.bashrc line="bind '\"\e[A\"':history-search-backward"

- name: Down Arrow Command Search
  lineinfile: dest=/etc/bash.bashrc line="bind '\"\e[B\"':history-search-forward"
Run Code Online (Sandbox Code Playgroud)

显然,最近的 ansible 更新改变了 lineinfile 的行为,因此该命令导致

bind \e[A:history-search-backward
bind \e[B:history-search-forward
Run Code Online (Sandbox Code Playgroud)

代替

bind '"\e[A"':history-search-backward
bind '"\e[B"':history-search-forward
Run Code Online (Sandbox Code Playgroud)

因此导致了奇怪的行为。

非常感谢Eric Renouf,他链接到另一个有类似问题的问题!