Terminal: Fix setting environment for stub process

The TerminalInterface was setting the environment of the target process
for the stub, this is uneccessary.

The ExternalTerminalProcessImpl was not using the environment
of the stub process which will be important later.

The TerminalProcessImpl was not setting the right environment either.

Task-number: QTCREATORBUG-27519
Change-Id: I89238feedd755d1f1cbe2255b71711e0d5c149d0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-06-13 09:00:09 +02:00
parent 3c2d545230
commit 43862f4cd4
2 changed files with 3 additions and 1 deletions

View File

@@ -108,6 +108,8 @@ expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData
cmdLine.addCommandLineAsArgs(setupData.m_commandLine, CommandLine::Raw);
process->setCommand(cmdLine);
}
process->setEnvironment(
setupData.m_environment.appliedToEnvironment(Environment::systemEnvironment()));
process->setEnvironment(setupData.m_environment);

View File

@@ -384,7 +384,7 @@ void TerminalInterface::start()
QTC_ASSERT(d->stubCreator, return);
ProcessSetupData stubSetupData = m_setup;
ProcessSetupData stubSetupData;
stubSetupData.m_commandLine = cmd;
if (m_setup.m_runAsRoot && !HostOsInfo::isWindowsHost()) {