bash 在 iTerm.app 中禁用 Ctrl 键
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5667687/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ctrl-key disabled in iTerm.app
提问by monotux
I'm trying to use the new iTerm appon my Snow Leopard Mac, but my Ctrlseems to be completely dead (as in non-responsive, as in nothing happens when I type Ctrl+aexcept for an outputed 'a') and I haven't found anything useful while googling. The closes match was this thread here on stackoverflow, but everything in Terminal.app works as it should.
我正在尝试在我的 Snow Leopard Mac 上使用新的 iTerm 应用程序,但我的Ctrl似乎完全死了(如无响应,因为当我输入Ctrl+时没有任何反应,a除了输出的“a”)并且我没有在谷歌搜索时发现任何有用的东西。最接近的匹配是stackoverflow 上的这个线程,但Terminal.app 中的所有内容都可以正常工作。
And, even more strange - I can Ctrl+zmyself out of applications, but I can't save files in Emacs (C-x C-s) or any other keyboard shortcuts that uses a Ctrlshortcut. And it's not local, since Ctrlis as broken on my iMac as it is on other unix computers I've sshed onto with iTerm. I've tried both in bash and zsh.
而且,更奇怪-我Ctrl+z我自己的应用程序,但我不能保存在Emacs(文件C-x C-s),或使用任何其他键盘快捷键Ctrl的快捷方式。而且它不是本地的,因为Ctrl在我的 iMac 上和在我使用 iTerm 使用的其他 unix 计算机上一样坏。我在 bash 和 zsh 中都试过。
I've tried to remove all files concerning iTerm.app in my ~/Library/Application Support, and I've tried the very latest version (currently 13 h old) of iTerm I could lay my hands on, but to no avail.
我试图删除我的 .app 中所有与 iTerm.app 相关的文件~/Library/Application Support,并且我已经尝试了我可以使用的最新版本(目前 13 小时)的 iTerm,但无济于事。
Any ideas?
有任何想法吗?
回答by tombolinux
I suggest to check this post to see if the ctrl key is enabled in your preferences
我建议查看此帖子以查看您的首选项中是否启用了 ctrl 键
https://apple.stackexchange.com/questions/52041/how-to-press-control-key-on-mac
https://apple.stackexchange.com/questions/52041/how-to-press-control-key-on-mac
Did you try to configure key bindings for this terminal emulator as specified in the iTerm wiki:
您是否尝试按照 iTerm wiki 中的规定为此终端模拟器配置键绑定:
http://code.google.com/p/iterm2/wiki/Keybindings
http://code.google.com/p/iterm2/wiki/Keybindings
at last, have you try set -o emacsor set -o vi?
最后,你有没有尝试set -o emacs或set -o vi?
If it works, set it in your ~/.bashrc to run it at login.
如果它有效,请将其设置在您的 ~/.bashrc 中以在登录时运行它。
回答by Felix Lange
This seems to be an iTerm bug.
这似乎是一个 iTerm 错误。
You can work around it by creating a key mapping in the profile settings.
Add a mapping for ^xso it sends 0x18(which is the encoded form of ctrl+x).
您可以通过在配置文件设置中创建键映射来解决它。添加一个映射^x以便它发送0x18(这是 ctrl+x 的编码形式)。



