If a Mac app is sandboxed, the $HOME environment variable points to the container, instead of the actual user home directory, thus preventing the default configuration to load.
On a sandboxed environment $HOME points to: /Users/<usr>/Library/Containers/<app-bundle-id>/Data
The correct way to fetch the home directory for a sandboxed environment according to Apple would be
#include <sys/types.h>
#include <pwd.h>
struct passwd *pw;
pw = getpwuid(getuid());
pw->pw_dir // correct $HOME
If a Mac app is sandboxed, the
$HOMEenvironment variable points to the container, instead of the actual user home directory, thus preventing the default configuration to load.On a sandboxed environment
$HOMEpoints to:/Users/<usr>/Library/Containers/<app-bundle-id>/DataThe correct way to fetch the home directory for a sandboxed environment according to Apple would be