reddit / emacs

MacOS right option modifier setting does not work when using Emacs in the terminal

volhodav · 2022-04-18 19:01
I have a macbook hooked up to an external monitor and use an external keyboard. I've already set it up in the MacOS terminal to use *alt (option) keys* as Meta in the options menu. So, I would like to disable the *Right-Alt (option) key* being recognised as Meta and use it to type special characters. I've found the setting *(setq mac-right-option-modifier nil)* and added it to my settings file (\~/.emacs). **Problem:** If I launch Emacs program through Finder as any other program the setting in the .emacs works fine: - Left-Alt = Meta key - Right-Alt is just Alt key However, if I launch Emacs through the terminal (the way I would like to use it) the Right-Alt (option) key is still being recognised as Meta key. Is there a way to fix this? This is the setting that I have in my .emacs config file: (setq mac-right-option-modifier nil) * OS: MacOS Monterey * Emacs version: 28.1 * Default MacOS terminal app for terminal
ieure · 2022-04-18 19:48
The settings you changed are Mac GUI-specific and don't work in any other context. Terminal emulators have no way of distinguishing modifiers at the level you want, and to the extent it's possible, is going to be a feature of the terminal emulator program itself, not Emacs.
[deleted] · 2022-04-19 14:27
[deleted]
volhodav · 2022-04-19 17:22
Thanks for the suggestion, I’ll have to give it a try and will post an update on here for others. Because I can’t imagine that I’m the only one that encountered this until now.
The_L_Of_Life · 2022-04-19 17:51
If you're using iterm2, there's a setting to set/unset option as meta
meatmechdriver · 2022-04-19 19:03
There is also [CSI](http://www.leonerd.org.uk/hacks/fixterms/) if your programs have support for it. iTerm2 has support for it.