I typically start GUI Emacs on macOS, https://bitbucket.org/mituharu/emacs-mac/overview, installed via Nix package manager, as part of a larger startup script on the terminal (iterm). While Emacs is loading I am entering passwords to decrypt various encfs volumes. Annoyingly, Emacs steals focus after a while, sometimes in the middle of entering a password on the terminal. I am aware of about when in the startup sequence this happens so I can simply wait for it to complete then switch focus back to terminal, but naturally I prefer to avoid this.
I've searched for all occurrances of
select-frame and while there are many instances of these they are not at top-level. To some of these few containing functions that I wondered may be getting called during init, I added
message printf style statements, restarted Emacs and read the
*Messages* buffer, none of these were printed out. I might have missed something though as I didn't try them all this way, just the most likely looking ones.
It may be a feature of the Emacs I use and I may have to patch to overcome, but I don't want to have to do that.
Any clues what I should look for to change this behavior?