Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espanso stops expanding after waking from sleep #138

Closed
WardsParadox opened this issue Dec 11, 2019 · 27 comments
Closed

Espanso stops expanding after waking from sleep #138

WardsParadox opened this issue Dec 11, 2019 · 27 comments
Labels
bug Something isn't working MacOS Related to the MacOS operating system

Comments

@WardsParadox
Copy link

WardsParadox commented Dec 11, 2019

Using espanso on macOS 10.14 or 10.15 (seems more noticeable though) seems to die after waking from a sleep. Sometimes using restart to restart the daemon fixes it, but not reliably. I have to usually perform a full restart to get it to start using expansions again.

@federico-terzi
Copy link
Collaborator

Hey @WardsParadox,
Thank you for your feedback, I'll take a look at it in the next few days and let you know :)

By the way, @timorunge are you suffering from the same problem?

Cheers

@federico-terzi federico-terzi added bug Something isn't working MacOS Related to the MacOS operating system labels Dec 12, 2019
@KingDestructo
Copy link

Running into the same issue as well. MacOS 10.15.2 on espanso version 0.5.0. Using restart doesn't seem to get it running again. I'm only able to get espanso running again on a full restart.

@WardsParadox
Copy link
Author

Found that running espanso stop waiting approx 10 seconds, then running espanso restart temporarily fixes it until it happens again.

@KingDestructo
Copy link

Found that running espanso stop waiting approx 10 seconds, then running espanso restart temporarily fixes it until it happens again.

Gave that a try a few times, doesn't seem to work for me. Even gave it a bit longer at about 30 seconds before restarting to no avail.

@KingDestructo
Copy link

For me, logging out and back in works. Faster than restarting, but still not ideal.

@federico-terzi
Copy link
Collaborator

Hey guys,
I'm sorry you are experiencing these problems, could you please post the output of espanso log after waking up from sleep?

I'm sorry I couldn't fix this issue yet, but unfortunately I can't reproduce this problem by myself. The macOS version has been developed on an Hackintosh, which doesn't support Sleep...

Thanks for your help :)

@WardsParadox
Copy link
Author

If I get it to trigger again, I'll get the logs. knock on wood it's been reliable as of late :)

@WardsParadox
Copy link
Author

And had to jinx it.

18:17:15 [ INFO] espanso version 0.4.1
18:17:15 [ INFO] using config path: /Users/mczack/Library/Preferences/espanso
18:17:15 [ INFO] using package path: /Users/mczack/Library/Application Support/espanso/packages
18:17:15 [ INFO] starting daemon...
18:17:15 [ INFO] Status icon already initialized, skipping.
18:17:15 [ INFO] Initializing EspansoNotifyHelper in /Users/mczack/Library/Application Support/espanso
18:17:15 [ INFO] EspansoNotifyHelper already initialized, skipping.
18:17:15 [ INFO] Binded to IPC unix socket: /Users/mczack/Library/Application Support/espanso/espanso.sock
18:17:15 [ INFO] espanso is running!

I was trying to run :date which just outputs the date in an iso format

@KingDestructo
Copy link

KingDestructo commented Feb 15, 2020

I've got my log here as well.

00:34:06 [ INFO] espanso version 0.5.0
00:34:06 [ INFO] using config path: /Users/tgibson/Library/Preferences/espanso
00:34:06 [ INFO] using package path: /Users/tgibson/Library/Application Support/espanso/packages
00:34:06 [ INFO] starting daemon...
00:34:06 [ INFO] Status icon already initialized, skipping.
00:34:07 [ INFO] Initializing EspansoNotifyHelper in /Users/tgibson/Library/Application Support/espanso
00:34:07 [ INFO] EspansoNotifyHelper already initialized, skipping.
00:34:07 [ INFO] Binded to IPC unix socket: /Users/tgibson/Library/Application Support/espanso/espanso.sock
00:34:08 [ INFO] espanso is running!

@KingDestructo
Copy link

I think I may have figured out the issue or possibly what's going wrong here. On Mac OS, there is a feature called "Secure Input" which captures keyboard input, usually when applications need to have passwords or secure information entered, which may be preventing espanso from capturing keyboard input. I use Amazon Workspaces frequently at work and as such, it being a remote pc program it needs to capture input from the keyboard. However, I noticed that when I would quit Amazon Workspaces, espanso would start expanding again. Then as soon as I started it once more, espanso would stop expanding text no matter what I did. I found out which application was capturing keyboard input using the method in this thread here: https://forum.keyboardmaestro.com/t/disable-secure-input/2410/4

I hope this helps!

@federico-terzi
Copy link
Collaborator

Hey guys,
Thank you for your help, your logs look totally fine.
@KingDestructo thanks for the tip. I'll check out the link and let you know if I find something!

Cheers :)

@bachya
Copy link

bachya commented Feb 24, 2020

I'm experiencing this, as well. Let me know what I can do to help debug! 👍

@federico-terzi
Copy link
Collaborator

federico-terzi commented Feb 25, 2020

Hey guys,
As I can't reproduce the issue on my machine, could any of you post the output of the following command after waking up from sleep and finding espanso as not working?

ioreg -l -w 0 | grep SecureInput

That will tell you the process ID (kCGSSessionSecureInputPID) of the application that has Secure Input enabled.

Could you also post the output of the following command in case the previous one returns something? (replacing NNN with the process ID found before)

ps auxww | grep NNN

Cheers :)

@bachya
Copy link

bachya commented Feb 29, 2020

Apologies for the radio silence, but after all sorts of actions (sleep/wake, rebooting, etc.), Espanso keeps working and hasn't exhibited this since... Will keep an eye out and post back if I see something.

@federico-terzi
Copy link
Collaborator

No problem @bachya, let me know if you find something :)

@KingDestructo
Copy link

@federico-terzi I haven't been able to reproduce the issue either since initial posting. I am still noticing that espanso stops working as soon as I run another application that uses SecureInput, which is still to be expected because the application is capturing keyboard input before espanso can.
However, I've run the application that is giving me issues and used the commands to get the output. I'm not sure how much use this will be because I haven't noticed espanso stop expanding SPECIFICALLY when it wakes from sleep. I've replaced the name of the computer in the output.

tgibson@COMPUTER_NAME  ~ % ioreg -l -w 0 | grep SecureInput
  |   "IOConsoleUsers" = ({"kCGSSessionOnConsoleKey"=Yes,"kSCSecuritySessionID"=100007,"kCGSSessionSecureInputPID"=6380,"kCGSSessionGroupIDKey"=20,"kCGSessionLoginDoneKey"=Yes,"kCGSSessionSystemSafeBoot"=No,"kCGSSessionIDKey"=257,"kCGSSessionUserNameKey"="tgibson","kCGSessionLongUserNameKey"="Tim Gibson","kCGSSessionAuditIDKey"=100007,"kCGSSessionLoginwindowSafeLogin"=No,"kCGSSessionUserIDKey"=501})
    | |   "IOConsoleUsers" = ({"kCGSSessionOnConsoleKey"=Yes,"kSCSecuritySessionID"=100007,"kCGSSessionSecureInputPID"=6380,"kCGSSessionGroupIDKey"=20,"kCGSessionLoginDoneKey"=Yes,"kCGSSessionSystemSafeBoot"=No,"kCGSSessionIDKey"=257,"kCGSSessionUserNameKey"="tgibson","kCGSessionLongUserNameKey"="Tim Gibson","kCGSSessionAuditIDKey"=100007,"kCGSSessionLoginwindowSafeLogin"=No,"kCGSSessionUserIDKey"=501})
tgibson@COMPUTER_NAME  ~ % ps auxww | grep 6380            
tgibson           6380   4.3  1.3  6311440 215776   ??  S     3:25AM   0:09.61 /Applications/WorkSpaces.app/Contents/MacOS/Workspaces
tgibson            872   0.0  0.0  4306380   4256   ??  S     4:26PM   0:01.38 /usr/libexec/pboard
tgibson           6412   0.0  0.0  4286712    688 s000  S+    3:27AM   0:00.01 grep 6380
tgibson@COMPUTER_NAME ~ % 

@federico-terzi
Copy link
Collaborator

Hey @KingDestructo,
Thank you for the update, it seems like the "WorkSpaces" app is requesting SecureInput, which in turn disables espanso.

which is still to be expected because the application is capturing keyboard input before espanso can.

As far as I know, it's not like the first app that receives the event blocks the others from receiving them. It is the fact that WorkSpaces request SecureInput that blocks espanso, which is expected as usually applications request "SecureInput" when there is sensitive content being typed.

Personally, I'm more worried about the possibility of espanso randomly stopping on wake up, as that would be definitely a problem. On the other hand, it's totally understandable if it stops when the user is entering a password.

Cheers :)

@WardsParadox
Copy link
Author

After 10.15.4 application, this issue has gotten worse.
Log below:

 espanso log
18:37:12 [ INFO] espanso version 0.4.1
18:37:12 [ INFO] using config path: /Users/mczack/Library/Preferences/espanso
18:37:12 [ INFO] using package path: /Users/mczack/Library/Application Support/espanso/packages
18:37:12 [ INFO] starting daemon...
18:37:12 [ INFO] Status icon already initialized, skipping.
18:37:12 [ INFO] Initializing EspansoNotifyHelper in /Users/mczack/Library/Application Support/espanso
18:37:12 [ INFO] EspansoNotifyHelper already initialized, skipping.
18:37:12 [ INFO] Binded to IPC unix socket: /Users/mczack/Library/Application Support/espanso/espanso.sock
18:37:12 [ INFO] espanso is running!

During the start from it and now 14:24, No expansion has occurred.

@bachya
Copy link

bachya commented Mar 30, 2020

@WardsParadox You are several versions behind – can you upgrade and see if that helps?

@WardsParadox
Copy link
Author

Wow, didn't even check on that. Updating now.

@WardsParadox
Copy link
Author

No change in behavior.

21:33:21 [ INFO] espanso version 0.5.3
21:33:21 [ INFO] using config path: /Users/mczack/Library/Preferences/espanso
21:33:21 [ INFO] using package path: /Users/mczack/Library/Application Support/espanso/packages
21:33:21 [ INFO] starting daemon...
21:33:21 [ INFO] Status icon already initialized, skipping.
21:33:21 [ INFO] Initializing EspansoNotifyHelper in /Users/mczack/Library/Application Support/espanso
21:33:21 [ INFO] EspansoNotifyHelper already initialized, skipping.
21:33:21 [ INFO] Binded to IPC unix socket: /Users/mczack/Library/Application Support/espanso/espanso.sock
21:33:21 [ INFO] espanso is running!

@federico-terzi
Copy link
Collaborator

Hey @WardsParadox,

I'm sorry you are still experiencing these issue, I'll look into it again as soon as I can.
Any idea on how I can reproduce the issue? How long do you keep the mac on sleep?

Cheers :)

@federico-terzi
Copy link
Collaborator

For everyone having this problem, I suggest you the following procedure:

  1. Stop espanso with espanso stop
  2. remove all the espanso entries in the Security & Privacy > Accessibility tab of the settings
  3. Register espanso again in the accessibility pane using espanso register

I still wasn't able to reproduce this problem on my machines, but I've read online that accessibility permissions on macOS Catalina are particularly buggy in general, and not just for espanso, and this procedure generally helps.

Another possible cause is the "Power nap" feature, which may be responsible of this problem, though I don't have any evidence about it. You could try disabling power nap for some time and see if that helps.

@johnrichardrinehart
Copy link

johnrichardrinehart commented Apr 28, 2020

I can confirm that the above suggestion solved my issue. Each login espanso would raise a pop-up notification (espanso-themed notification modal) saying something like "espanso is requesting SecureLogin and will be disabled until"...~

So, I performed the above 3 steps. Now, no such pop-up notifications (yet) at login.

..... Well, it's back.

@federico-terzi
Copy link
Collaborator

Hey,
I'm going to close this issue as it's been a while since the last follow up.
Let me know if you have other questions.
Cheers :)

@shortenjukebox
Copy link

Unfortunately I’m having this issue. I’m on espanso 0.7.1 – updating now!

The issue occurs irregularly (yet frequently) after logging in from sleep. espanso triggers a notification saying SecureInput is being used by loginwindow or whichever application is in focus. The issue persists despite restarting espanso, although can temporarily be resolved by re-registering espanso’s Accessibility permission as mentioned in 138#issuecomment-606618291.

@federico-terzi
Copy link
Collaborator

Hey @shortenjukebox,
I'm sorry you experienced this problem! You can also try following one of these steps: https://smilesoftware.com/textexpander/secureinput/

Often that behavior is due to a misbehaving password manager, so you might need to check that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MacOS Related to the MacOS operating system
Projects
None yet
Development

No branches or pull requests

6 participants