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?

simona
  • 403
  • 2
  • 4
  • 7
  • Possibly related: [Problems with keybindings when using terminal](http://emacs.stackexchange.com/questions/1020/problems-with-keybindings-when-using-terminal). – Dan Feb 08 '15 at 13:56
  • 1
    I don't recognise those variables and can't find documentation for them. Have you tried `set-keyboard-coding-system' ? – Andrew Swann Feb 08 '15 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 Feb 08 '15 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 Feb 08 '15 at 21:21

3 Answers3

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."

mattsilver
  • 450
  • 4
  • 8
15

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

Jason Zhou
  • 151
  • 1
  • 5
  • How does this answer the question? Please explain. Just circling part of a screenshot does not answer the question well. – Drew Feb 20 '18 at 17:51
0

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

enter image description here