Strange behaviour for setenv & getenv in OS X Yosemite

后端 未结 1 1128
误落风尘
误落风尘 2021-01-25 06:09

When I set an environment variable

launchctl setenv FOO test

I can fetch the value by

launchctl getenv FOO

wh

相关标签:
1条回答
  • 2021-01-25 06:45

    As I wrote in section Issues / problems here in order your env variables were correctly taken by applications after system reboot you will need:

    • either login twice: login => logout => login
    • or close & re-open applications manually, where env variables should be taken
    • or do NOT use feature "Reopen windows when logging back".

    This happens due to Apple denies explicit ordering of loaded services, so env variables are registered in parallel with processing of the "reopen queue".

    0 讨论(0)
提交回复
热议问题