Currently, my Atom installation no longer inherits environment variables when launched from anything other than a terminal. This is a particular problem for developing in the Go programming language (golang) because an environment variable,
$GOPATH, is required to access code completion and linting tools.
This issue is well known and has a long history with Atom. On macOS/OS X, your login shell is not involved in the startup of the OS in the same way as Linux. The desktop environment, dock, etc are started directly by the root process,
launchd. Because environment variables declared by your login shell are not set unless your shell is an ancestor in the process tree, apps launched from the dock do not see the same environment as apps launched from your shell.
This OS quirk was circumvented by the environment package for older versions of Atom, and this fix was merged into Atom itself in v1.7.0.
However, this fix seems to have regressed. I am not sure when my machine first started showing this problem again. I am on Atom v1.9.8 and OS X v10.11.6.
My questions: Has this regression affected others? If so, does the dev team know? If not, what are the likely system configurations that could lead to not having the environment I want?
For now, I will revert to launching Atom from my terminal.
P.S. I believe the implementation of this fix caused startup slowdown on my machine, perhaps because of my shell setup.