Karabiner-Elements cannot open new Terminal window unless Terminal already in focus I am on Catalina 10.15.7 and use Karabiner-Elements 13.3.
When I use the rule shown below for opening Terminal nothing happens unless Terminal is in focus (you can see Terminal on the menu bar).
Seems like something to do with security permissions. When I run the script itself from within iTerm (not Terminal) I got a pop up asking for allowing &quot;access to control&quot;. Once accepted the shortcut worked when either Terminal or iTerm was in focus.
Obviously I want the shortcut to work regardless of what is in focus. How to achieve that?
{
  &quot;title&quot;: &quot;Open Terminal&quot;,
  &quot;rules&quot;: [
    {
      &quot;description&quot;: &quot;Open Terminal&quot;,
      &quot;manipulators&quot;: [
        {
          &quot;type&quot;: &quot;basic&quot;,
          &quot;from&quot;: {
            &quot;modifiers&quot;: {
              &quot;mandatory&quot;: [
                &quot;left_control&quot;,
                &quot;left_alt&quot;
              ]
            },
            &quot;key_code&quot;: &quot;t&quot;
          },
          &quot;to&quot;: [
            {
              &quot;shell_command&quot;: &quot;osascript -e 'tell app \&quot;Terminal\&quot;' -e 'do script \&quot;tmux\&quot;' -e 'end tell'&quot;
            }
          ]
        }
      ]
    }
  ]
}
I played with your key def for Karabiner. (Note that I'm on Big Sur, Karabiner 13.3). Here's what worked for me:
After the first time that I installed and activated your shortcut and tried to use it a dialog came up asking to allow some accessibility or privacy permission. I accepted it without noting exactly what it said but looking through the Privacy permissions in System Preferences I saw that a permission for Automation to allow &quot;karabiner_console_user_server&quot; to control &quot;Terminal&quot; had been added and its checkbox was checked. At first I didn't think the shortcut had done anything but then I found that Terminal had been opened and the tmux script had been run. (I don't have the tmux script so it failed for me but was displayed in Terminal as a command.) Terminal was the bottom most application (shown last in the application chooser). So when testing the shortcut be sure that Terminal isn't hiding behind everything.
At one point I found that if Terminal was running but hidden behind other apps, using the shortcut did work but left it hidden. When it was visible the shortcut did appear to work as desired.
In continued testing I checked and unchecked the Automation preference checkbox at various times and when it was checked the shortcut did attempt to run the tmux script. When it was not checked Terminal did open (behind other apps) but the script appeared not to run. I was not asked to accept any privacy permissions after the first time it had asked after installation (probably because Apple prefers confusing someone by not displaying repeated permission requests rather than annoying someone with multiple requests and confusion tends to result in fewer complaints than annoyances).
So be sure that the Automation privacy permission in System Preferences that I mentioned above exists and that it is checked. It's probably a good idea to quit and restart Karabiner-Elements as well; I did that at various times just in case. If the permission isn't shown (checked or unchecked) then something else isn't working. Adding permissions for an application to automate another something that, for some reason, can't be added manually and is only asked for when one actually does something that requires the permission (and possibly only once), don't ask me why. (Note that I didn't ever shut down and restart to see if I'd be asked to allow the permission again though I think it wouldn't. I'm not sure.)
I hope getting the shortcut to work is as simple as this but I imagine there are plenty of other possibilities that might be the issue.