In the Terminal app my $PATH is:
/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
If the user starts my C++ application using Dock, its $PATH is:
/usr/bin:/bin:/usr/sbin:/sbin
I would like my app to always has the same $PATH as terminal (bash) has.
Is there an easy way to achieve this?
The only way I'm aware of for now is to create a bash script on the disk with something like echo $PATH, launch it from my C++ program using bash -l command, read the output and update my process' PATH variable accordingly.
And, I do not want to change user system's config in any way. This should work without any additional actions required from the user and do not affect the user's system in any way.