I know this is an old thread. But I too am experiencing this - and have been for several years.
## Example
If I type my snippet: `url@someclientsname` - then it should expand to the clients URL, such as: www.some-clients-website.com
But every now and then, it doesn't expand.
## My observations and findings
- Quickfixes: 95% of the time, it works if I simply delete my snippet and type it again. Sometimes I have to do it twice or three times for it to work. If that doesn't fix it (the 5% of times), then if I CMD+Tab away from the program and then CMD+Tab back into the program, then my snippet works.
- Programs: I've seen it happens in all kinds of programs: Chrome, Obsidian, Sublime text, PhpStorm, iTerm, etc.
- Memory usage: I have a gut-feeling, that if my computer is under stress (using a lot of memory), that that correlates with the snippets failing to expand. I tried installing iStatistica Pro and looking into the Application Monitor, but I haven't seen clear evidence yet.
- Secure input enabled: I also heard the theory about 'Secure input enabled' and went above and beyond to figure out, if that could be an explanation. Conclusion: I'm pretty sure that it isn't. See the elaborated explanation below for more info.
- Upon login: Whenever I just unlock, open or log in to my computer, sometimes (5-15% of the time), the snippet doesn't expand until I've done the CMD+Tab-trick (see above).
- Password Manager (1password): I'm using 1password as my password manager. And there is an increased chance of the snippet failing to expand after I've fetched a password from the "Quick-fetch password"-functionality from 1password (Shortcut: Shift + CMD + \ ). It's about 30-50% of the time, after I've fetched a 1password-password, that the snippets fail. And if it fails, then one of the quickfixes from above will fix it (always).
- Safari: Another hunch is that Safari 'hangs on' to Secure Login and keeps it enabled for longer that Chrome. But I can't prove that directly either.
## Disproving the "Secure input enabled"-theory
I could read this in several places. And even though it does tick a bunch of boxes, my gut-feeling told me, that it wasn't it.
The problem with proving this, is to see when Secure Login is enabled, since it would entail going to a terminal and writing a command to see if Secure input, was enabled. And to do so, there we be a good chance that while doing so, one of disable Secure Input.
So I installed a program called TextBar, where I can execute scripts continuously and output the result in my Menu Bar. That way I can, at all times, see if Secure Input is enabled and see which program did it. Here are my two scripts:
Determining if secure input is enabled:
#!/bin/bash
SID=`ioreg -l -w 0 | grep SecureInput`
if [[ "$SID" != '' ]]; then
echo ' Secure Input is Active '
else
echo ' Not active '
fi
Determining which program enabled secure input:
#!/bin/bash
culprit=`ioreg -l -w 0 | grep SecureInput | sed 's/ //g'`
if [ -z "$culprit" ]
then
echo ' No culprit '
else
echo " ${culprit:0:20} "
fi
But after having those running every second for months, I cannot see any program causing the problem. Every time a snippet fails, I check my menu bar, to see if Secure Login is the one failing the snippet to expand - and it almost never is.
Previously I had a feeling that it was related to the login of my computer, that didn't disable Secure Input. And I can see now (with my script), that if I log in, that it keeps the Secure Input enabled for 2-3 seconds, but now consistently Secure Input is being disabled. QED. 🙂