It looks like since many functions in launchctl were deprecated this approach does not work.
cat ~/Library/LaunchAgents/environment.plist
envsync
local.envsync
ProgramArguments
sh
-c
launchctl setenv foo "bar"
RunAtLoad
launchctl load ~/Library/LaunchAgents/environment.plist
/Users/.../Library/LaunchAgents/environment.plist: Operation not permitted
launchctl setenv foo "bar"
Not privileged to set domain environment.
load is apparently now a "Legacy Subcommand". The setenv subcommand also has issues.
It looks like since many functions in launchctl were deprecated this approach does not work.
cat ~/Library/LaunchAgents/environment.plist
envsync local.envsync ProgramArguments sh -c launchctl setenv foo "bar" RunAtLoadlaunchctl load ~/Library/LaunchAgents/environment.plist
/Users/.../Library/LaunchAgents/environment.plist: Operation not permitted
launchctl setenv foo "bar"
Not privileged to set domain environment.
load is apparently now a "Legacy Subcommand". The setenv subcommand also has issues.