使iTerm以与其他操作系统相同的方式翻译“元键” [英] Making iTerm to translate 'meta-key' in the same way as in other OSes

查看:182
本文介绍了使iTerm以与其他操作系统相同的方式翻译“元键”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用emacs键绑定的bash shell中,可以使用组合键(如M-f,M-b)分别在shell提示符上向前或向后移动一个单词。通常,元键在Windows和Linux上映射为Alt键。然而,在iTerm中,我找不到一种方法将此元键映射到MacBook Pro上的Option或Command键。

In bash shell with emacs key-binding, you can use key combination like M-f, M-b to move one word forward or backward on the shell prompt respectively. Usually, the meta key is mapped to Alt key on Windows and Linux. However, in iTerm, I could not find a way to map this meta key to either Option or Command key on my MacBook Pro.

似乎在OS X中,元键默认映射到ESC键。所以你可以使用ESC-f,ESC-b在iTerm。但是,ESC键显然不实用。此外,iTerm有允许您为元键(书签>配置文件>键盘配置文件>全局>选项键为...)修改映射,这个设置似乎不工作的选项。

It seems that in OS X, the meta key is by default mapped to ESC key. So you can use ESC-f, ESC-b on iTerm. However, ESC key is apparently not practical to use. In addition, iTerm does have option that allow you to modifier mapping for the meta key (Bookmarks > Profiles > Keyboard Profiles > Global > Option Key as...), this setting does not seem to work at all.

因此,如果任何人知道这个问题的解决方案是什么,请让我知道。

Therefore, if anyone know what is the solution to this problem, please let me know.

我已升级到最新版本0.9.6.1012,此行为仍然存在。

I have upgraded to the latest release, 0.9.6.1012, and this behavior is still persist.

strong>修改:我的问题的一些澄清。我说的键绑定是为bash shell,而不是在emacs。只是碰巧,默认情况下,bash shell也使用与emacs相同的键绑定。

Some clarification to my question. The key-binding I'm talking about is for bash shell, not in emacs. It just happens that, by default, bash shell also use the same key-binding as emacs.

推荐答案

书签>管理个人资料。然后选择键盘配置文件>全局,并选择选项键作为元。这对我的版本0.9.6.1201。

Go to Bookmarks > Manage Profiles. Then select Keyboard Profiles > Global and choose Option Key as Meta. This works for me in version 0.9.6.1201.

这篇关于使iTerm以与其他操作系统相同的方式翻译“元键”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆