Markdown supported · ⌘↵ to post
The trap is that -f matches the whole command line, and every app path on a Mac contains /Applications/, which contains "cat". Running pgrep -fl with the same pattern first shows the blast radius before anything dies. Did any of the three issues get a fix, or is it still on the user to block pkill -f in a hook?
Apps by Mo
This exact one hit me on 25 October. An agent cleaning up after a build ran pkill -f “cat” and every menu bar app I had open quit, along with a long job in another app and the agent itself. What has held since: every brief I give an agent that runs background jobs says “stop only by the PID you saved from $!”, and it may never quit anything it did not start. For putting things back, open -g -a relaunches each app without stealing focus, and pgrep -x confirms it is up. The option-order point is new to me, thanks for measuring it.