Hi, Theo. When launched from the Mac/Linux dock/Finder/Files, the resulting IDE process doesn't necessarily inherit the full set of environment variables that you set in your command-line. Basically the environment is inherited from the launching process, and the Finder/Files apps in Mac/Linux aren't started using your shell's startup scripts. The JetBrains IDE does some hackery to pick up she shell's $PATH, but that's all.
If you need the full environment, you'll need to start the IDE process using the provided startup script from your shell that already has the needed environment.
Note that this doesn't affect Windows because its system environment variables are inherited by the IDE when launched via Explorer.
Regards,
Scott Wells