Use a login shell to extract the PATH.

This commit is contained in:
Martín Lucas Golini
2025-06-15 23:14:04 -03:00
parent 64af75824e
commit d1533537f9

View File

@@ -3355,7 +3355,7 @@ static std::string getDefaultShell() {
static std::string getShellEnv( const std::string& env, const std::string& defShell = "" ) {
std::string shell = defShell.empty() ? Sys::which( getDefaultShell() ) : defShell;
Process process;
if ( process.create( shell, "-c env", Process::getDefaultOptions() ) ) {
if ( process.create( shell, "-l -c env", Process::getDefaultOptions() ) ) {
size_t envLen = env.size();
std::string buf( 32 * 1024, '\0' );
process.readAllStdOut( buf );