Mac OS X terminal [Use option as meta key] undo backslash on a Spanish keyboard

I checked the option β€œUse the option as a meta key” in Mac OS X Terminal because I like to use emacs to move between the words: Mf & Mp.

But if I do this, I cannot get the backslash (option + ΒΊ; i.e. option + key to the left of 1 in the Spanish keyboard). If I uncheck, I can enter a backslash, but I do not have Mf & Mr.

Is there a way to get both?

+9
bash terminal macos
source share
6 answers

Not a great solution, but XTerm (runs on X11 on OS X) can use CMD as a meta key.

You may also have good KeyRemap4MacBook results.

As well as a side benefit, XTerm should also give you the right interaction with the final mouse, for example. in Emacs or ncurses applications.

+1
source share

Most likely, you will have more problems with this setting, because Mac OS uses "Alt" as a modifier in many shortcuts. But anyway, including the following line in your ~ / .bash_profile will send a backslash if you enter the Unicode character "∫" (this is E288AB):

bind '"\033\xE2\x88\xAB"':'"\\"' 
+1
source share

You can customize the keyboard map to use a different key to enter a backslash. Take a look

Settings> Settings> [Profile]> Keyboard

For example, you can map Control-F1 to a backslash.

Note that the keyboard map by default displays Option-Left / Right Arrow in Mb / f, so you can use them instead of using the option for Meta (you need to get used to using the arrow keys instead of b and f, but Ive never got used to to use b and f and preferred the arrow keys).

+1
source share

The default exit key works like a meta key; there is no need to use the option as a meta key (except for a more convenient location).

+1
source share

I had the same problem. This is how I solved it.

I replaced the built-in terminal iTerm2, which also gave me some other nice features. To get a normal meta key, I did the following:

For the profile that I wanted to use, I checked "Alt send + Esc", which returned me a reasonable meta key that works in Emacs, Bash and others. However, I lost the backslash key. Thus, to return it and add the anchor in the profile that performs "Send text: \", and then anchored it to my backspace key combination (Shift-Alt-7, I'm Norwegian).

Now I have Mf, Mb in Emacs, M-. in Bash and I can send a backslash. I also have a Visor shell session that can be pushed down by pressing another key combination.

0
source share

This is a few years later, but for people who go to this page while searching for a solution, like me, I decided to create it myself.

This is a simple application in the status bar that runs in the background and transcribes all key events with the left Alt + $ KEY key to two key events in quick succession: Esc, then $ KEY; however, it only does this if Terminal.app is the target application.

You can find it here at https://github.com/habibalamin/Metalt .

0
source share

All Articles