macos-lsenvironment-path-pin
Installation
SKILL.md
The environment dictionary pins PATH
A packaged macOS app can carry environment variables in its property list under LSEnvironment —
the Launch Services environment dictionary. It is the normal way to set an allocator flag, a
runtime toggle or a debug switch for a shipped app.
It has one side effect that is easy to miss and expensive to find:
Declaring the dictionary at all pins the process
PATHto/usr/bin:/bin:/usr/sbin:/sbin.
Not any particular key — the presence of the dictionary. Anything the app then starts as an
external process sees only those four directories. Tools installed by a package manager, in the
user's home, or anywhere under /usr/local are simply not found.
Two properties of the dictionary decide when it applies: