Skip to content

macOS text espansion fails due to accessibility issues(?) #2576

Closed

Description

@mzfr

Description

Since I was asked to open a new issue(#2573 (comment)) so here is all the information about it

As I said in my old comment(#2573 (comment)) I had already tried with latest version of espanso(2.3.0) with a clean build and it didn't work.

After seeing this(#2573 (comment)) comment I tried again here is what I did

  • shutdown espanso

  • killall espanso to ensure no lingering processes

  • pgrep espanso -- make sure espanso isn't automatically restarting itself (e.g. from the launchd agent), this should have no output

  • remove Espanso from the Privacy & Security -> Accessibility settings

  • removed Espanso from the Login Items. T

  • I removed the following files/folder manually

rm ~/Library/LaunchAgents/com.federicoterzi.espanso.plist
rm ~/Library/Preferences/com.federicoterzi.espanso.plist
rm ~/Library/Preferences/espanso.plist
rm -rf ~/Library/Caches/espanso/

and just to make sure I wasn't missing something I ran the commands below as well:

launchctl remove com.federicoterzi.espanso
tccutil reset Accessibility com.federicoterzi.espanso
  • install Espanso
    • I tried with both, brew and direct download from release, so I did the above process twice
  • Tried running it via terminal: espanso service start
espanso service start                                                                                                                        

Unable to start espanso as a service as it's not been registered.
You can either register it first with `espanso service register` or
you can run it in unmanaged mode with `espanso service start --unmanaged`

NOTE: unmanaged mode means espanso does not rely on the system service manager
      to run, but as a result, you are in charge of starting/stopping espanso
      when needed.
unable to start service: not registered as a service

So then I ran open -a "espanso", this opened the whole provide accessibility permissions popup. After all approvals, espanso still doesn't work for me.

The only way I have been able to make it work is if I leave espanso daemon running in a tmux/terminal window

Steps to reproduce

No response

Expected behavior

No response

Screenshots

No response

Logs

  • In ~/Library/Caches/espanso/espanso.log
12:30:00 [daemon(42328)] [INFO] reading configs from: "~/Library/Application Support/espanso"
12:30:00 [daemon(42328)] [INFO] reading packages from: "~/Library/Application Support/espanso/match/packages"
12:30:00 [daemon(42328)] [INFO] using runtime dir: "~/Library/Caches/espanso"
12:30:00 [daemon(42328)] [INFO] system info: Darwin v15.7.2 - kernel: 24.6.0
12:30:00 [daemon(42328)] [INFO] watching for changes in path: ~/Library/Application Support/espanso
12:30:00 [daemon(42328)] [INFO] espanso version: 2.3.0
12:30:00 [daemon(42328)] [INFO] spawning the worker process...
12:30:00 [daemon(42328)] [INFO] binded to IPC unix socket: ~/Library/Caches/espanso/espansodaemonv2.sock
12:30:00 [worker(42329)] [INFO] reading configs from: "~/Library/Application Support/espanso"
12:30:00 [worker(42329)] [INFO] reading packages from: "~/Library/Application Support/espanso/match/packages"
12:30:00 [worker(42329)] [INFO] using runtime dir: "~/Library/Caches/espanso"
12:30:00 [worker(42329)] [INFO] system info: Darwin v15.7.2 - kernel: 24.6.0
12:30:00 [worker(42329)] [INFO] binded to IPC unix socket: ~/Library/Caches/espanso/espansoworkerv2.sock
12:30:00 [worker(42329)] [INFO] monitoring the status of the daemon process
12:30:00 [worker(42329)] [INFO] using CocoaAppInfoProvider
12:30:00 [worker(42329)] [INFO] monitoring the status of secure input
12:30:00 [worker(42329)] [INFO] using CocoaSource
12:30:00 [worker(42329)] [INFO] using MacInjector
12:30:00 [worker(42329)] [INFO] using CocoaClipboard
  • /tmp/espanso.err was empty

NOTE: I manually changed the paths from /Users/<username>/.... to ~/....

Your environment

OS: macOS 15.7.2 24G325 arm64
Host: MacBookPro18,1
Kernel: 24.6.0
  • I tried the method above with both direct download and brew install

Self-service

  • I'd be willing to fix this bug myself.

Activity

  1. added
    bug
    needs-triage
    on Nov 15, 2025
  2. mzfr commented on Nov 15, 2025

    @mzfr
    Author

    So I started looking into this.

    • I made sure that espanso was in Privacy & Security -> Input Monitoring
    • I ran log stream --predicate 'subsystem == "com.apple.TCC"' --level debug and noticed
      Failed to match existing code requirement for subject com.federicoterzi.espanso and service kTCCServiceListenEvent
            certificate leaf[subject.OU] = K839T4T5BY
            certificate leaf[subject.OU] = "6424323YUH"
    • I also noticed when I run espanso the binary paths are different for different execution
    $ open -a "espanso"
    $ ps aux | grep espanso | grep worker      
    
    user1      54932   0.0  0.2 411319392  37712   ??  S    12:54PM   0:00.11 /Applications/Espanso.app/Contents/MacOS/espanso worker --monitor-daemon
    
    $ espanso daemon
    $ ps aux | grep espanso | grep worker
    
    user1      55955   0.7  0.2 411325264  41536 s008  S+   12:56PM   0:00.10 /opt/homebrew/bin/espanso worker --monitor-daemon
    

    I know they are symlink /opt/homebrew/bin/espanso -> /Applications/Espanso.app/Contents/MacOS/espanso but its likely that TCC granted all those permissions to one binary and not the other(?) and I am saying this because we are seeing two different signatures(K839T4T5BY, 6424323YUH) for the same code/binary.

    So I tried to add both the paths manually in the Accessibility permissions and tried using espanso, it didn't work.

    But here is the weird part, I removed it using

    $ tccutil reset ListenEvent com.federicoterzi.espanso   
    Successfully reset ListenEvent approval status for com.federicoterzi.espanso
    
    $ tccutil reset Accessibility com.federicoterzi.espanso                                                                                        
    Successfully reset Accessibility approval status for com.federicoterzi.espanso
    

    Then I ran

    $ espanso service start
    espanso started correctly!
    
    $ espanso restart
    espanso started correctly!
    

    And it works 🎉

    Just to be sure I checked

    $ ps aux | grep espanso | grep worker                                                                                                          01:08:14 PM
    user1      60745   0.0  0.3 411339696  44512   ??  S     1:05PM   0:01.35 /Applications/Espanso.app/Contents/MacOS/espanso worker --monitor-daemon
    

    So those two ID's we saw initially, one of them was a new one(6424323YUH) and the K839T4T5BY

    $ codesign -dvvv /Applications/Espanso.app 2>&1 | grep -i "TeamIdentifier"    
    
    TeamIdentifier=6424323YUH
    

    I think using those tccutil commands reset the stale(K839T4T5BY) entry from my TCC database


    TL;DR: There is a possibility that your TCC database has a stale espanso ID, reset it using the commands below and then reinstall or do the grant permission process again

    tccutil reset ListenEvent com.federicoterzi.espanso
    tccutil reset Accessibility com.federicoterzi.espanso
    
  3. mzfr commented on Nov 15, 2025

    @mzfr
    Author

    Ah, I missed that small note in the PR(#2562) about using tccutil to reset Espanso's accessibility permissions, so I ended up causing unnecessary noise, Sorry.

    To remove Espanso's accessibility permissions, more advanced users can probably also run sudo tccutil reset Accessibility com.federicoterzi.espanso; be careful, omitting com.federicoterzi.espanso may reset all of your Accessibility permissions ↩

  4. n8henrie commented on Nov 17, 2025

    @n8henrie
    Collaborator

    No worries, glad you got it sorted out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions