22

I am on a mac and I am running emacs 24.4.1, but I have the same problem also with 22.1.1. When I open mac on a terminal on the remote host, it does not recognise option key (alt) like the meta key. I have modified the .emacs in the following way

(setq mac-option-key-is-meta nil
      mac-command-key-is-meta t
      mac-command-modifier 'meta
      mac-option-modifier 'none)

so I have tried to change the meta key to command, but also in this case the meta key doest work . This only work on the X version of emacs (when I open emacs in a new window), both with the option as meta key that as command as meta key. This is a problem I have with emacs in the terminal-only.

Now I don't know how to run commands in emacs! is there any keybinding I can use?

4
  • Possibly related: Problems with keybindings when using terminal.
    – Dan
    Commented Feb 8, 2015 at 13:56
  • 1
    I don't recognise those variables and can't find documentation for them. Have you tried `set-keyboard-coding-system' ? Commented Feb 8, 2015 at 14:02
  • 2
    I believe that's the "problem" with the terminal. You need to open its keyboard settings and check the corresponding option. I don't remember off the top of my head what it's called, but it's not difficult to find either.
    – wvxvw
    Commented Feb 8, 2015 at 15:54
  • 1
    @wvxvw it is what you say: in terminal > preference > keyboard > there is the option 'use option as meta-key'. It works! thank you
    – simona
    Commented Feb 8, 2015 at 21:21

3 Answers 3

27

This is a setting in Terminal.

In Terminal 2.5.1 the option is set differently than in the above comments:

In the main Terminal menu, choose "Preferences" to open a dialog. Click the "Profiles" icon in the top of the dialog.

In the Profiles section, make sure there is a check in the checkbox called "Use Option as Meta key."

1
  • That makes both Option keys Meta and I cannot type special symbols without Options. Is there a way to type them in that case?
    – sçuçu
    Commented Apr 13 at 12:29
15

I solve the problem with answer of ohruunuruus. Maybe post a snapshot will be more easy to understand. enter image description here

2
  • How does this answer the question? Please explain. Just circling part of a screenshot does not answer the question well.
    – Drew
    Commented Feb 20, 2018 at 17:51
  • That makes both Option keys Meta and I cannot type special symbols without Options. Is there a way to type them in that case?
    – sçuçu
    Commented Apr 13 at 12:29
0

I'm using iTerm2 and find out that setting the Option key to Esc+ helps.

enter image description here

1
  • I was looking for a method to do this on Emacs in a terminal and it works. But also it does not look like a problem to have ESC as the METa key and keep using Emacs in Terminal.app.
    – sçuçu
    Commented Apr 14 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.