1

I'm trying to find a way to use only the left option key as the Meta Key in osx Terminal, but leaving the right option with it's normal functions (special characters #, @, etc.).

Is there any way to config it to work this way? (Basically i want to achieve the same functionality that iterm has to use only one option as meta and the other as normal option)

EDIT: Also, a solution using Karabiner would be welcome too

Ghost
  • 1,426
  • 5
  • 19
  • 38

3 Answers3

1

it now support delay "Option::KEYTOKEY_DELAYED_ACTION"

https://pqrs.org/osx/karabiner/xml.html.en#syntax-KeyToKey-options

dunkaroo
  • 156
  • 7
1

Starting form ant's solution and digging inside the Karabiner.app package to see how it works, I found a way to make it work using only Karabiner :

Simply edit your Karabiner private.xml (found in ~/Library/Application Support/Karabiner/private.xml ) to the following :

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>TERMINAL</appname>
    <equal>com.apple.Terminal</equal>
  </appdef>

  <item>
    <name>Option-Left to Meta in Terminal</name>
    <only>TERMINAL</only>
    <identifier>private.optionltometa</identifier>
    <autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::VK_MODIFIER_EXTRA1</autogen>
    <include path="/Applications/Karabiner.app/Contents/Resources/include/checkbox/apps/terminal/meta_modifier_key.xml">
      <replacementdef>
        <replacementname>BEFORE</replacementname>
        <replacementvalue>KeyCode::ESCAPE</replacementvalue>
      </replacementdef>
      <replacementdef>
        <replacementname>AFTER</replacementname>
        <replacementvalue></replacementvalue>
      </replacementdef>
  </include>
</item>

</root>

Then launch Karabiner and press the Reload XML button in the Change Key tab (I'm using version 10.22.0, maybe the tab names have changed in newer versions)

The advantage of this method is that it does not disable your left option key when you are not using Terminal, as the solution using Seil does.

philb
  • 2,031
  • 15
  • 20
0

You should be able to use a combination of Seil and Karabiner to get this done. First, install Seil and remap the Option_L key to keycode 110, which is the PC Application Key. Then in Karabiner, expand For Applications tree and then Enable at only Terminal and finally Meta Modifier Key. Select the PC Application Key to Meta Modifier Key in Terminal option.

ant
  • 243
  • 2
  • 8
  • "PC Application Key to Meta Modifier Key in Terminal option" Where is that option? – Ghost Mar 16 '16 at 19:27
  • You can search for 'meta' in the search box or follow tree as described. For Applications/Enable at only Terminal/Meta Key Modifier/PC Application Key to Meta Modifier Key in Terminal. Make sure you have the latest Karabiner. I'm using 10.15.0 – ant Mar 17 '16 at 02:50