Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command key as Meta key in OS X Terminal.app

When i unckeck the 'Use option as meta key' box in Settings, and then do Cmd+F (which i want to mean Meta+F for forward-word in bash) Terminal gives me a 'find word' popup, which isn't what i want. What i really want is for my Terminals to behave just like an xterm w.r.t. the key bindings. Is there any way to disable this popup and its binding?

I know i could just use actual xterms, but for a variety of reasons i want to use Terminal.

thanks in advance, Eric

like image 285
subopt Avatar asked Dec 06 '09 20:12

subopt


People also ask

Which key is Meta on Mac?

Unfortunately, keyboards without a meta key, and on macOS, this mean that meta key is replaced by the esc key which is not convenient at all and often more clunky than helpful. Though, you can have your macOS Terminal configured to use the option key as a meta key.

What keyboard key is Meta?

The meta key is a key on some keyboards, normally located next to the spacebar, that performs special functions when combined with another key. It originated on keyboards for Lisp computers in the 1960s, and its use continued on Sun computers where the key was marked with a diamond shape.

How do you use commands in Terminal Mac?

In the Terminal app on your Mac, press the Up Arrow key. The last command you entered appears on the command line. Continue pressing the Up Arrow key until you see the command you want, then press Return.

Is command and control key the same?

The Command key is sometimes used like the Control key in Windows; for example, Command-P and Control-P print a document. However, the Mac's Option key is also used for Windows Control key functions. See Control key.


1 Answers

The option as meta key selection has no effect on the Command (Apple) key. If option as meta key is selected, then the Option key acts as a Meta key in bash and elsewhere; just press Option+F. If you de-select it, there is no Meta key. (In either case, some command line programs may recognize the traditional ESC+char sequence as Meta char.)

If you are running OS X 10.6 (Snow Leopard), Apple supplies a built-in way to change the meaning of the keyboard modifier keys, including Command and Option. Go to System Preferences -> Keyboard and click on the Modifier Key... button. A panel will appear that allows you to, for instance, swap the meaning of the Option and Command keys. But, be warned that this is a global option and will apply everywhere on OS X and could lead to some major confusion. If you do that, you will be swimming upstream as noted here. You will likely be best served long-term by getting used to the OS X default of using the Option key as Meta and, if necessary, restoring application defaults (for Emacs, say) to follow that convention.

FURTHER EDIT: This blog post and program (untested) might be helpful.

like image 121
Ned Deily Avatar answered Sep 20 '22 20:09

Ned Deily