diff options
author | Marcus Tillmanns <[email protected]> | 2024-06-04 09:09:07 +0200 |
---|---|---|
committer | Marcus Tillmanns <[email protected]> | 2024-06-04 08:43:01 +0000 |
commit | a30eb2ccc49a50828f24fd69b308c122092fbfff (patch) | |
tree | 987436a49e37851c1657ea83dc2b459015cefbfb /src/libs/utils/terminalinterface.cpp | |
parent | 1543ead1b641b4ae5e60b3e65663da16ec44e618 (diff) |
Utils: Fix terminal process environment
The TerminalInterface did not fallback to the system environment
if no environment was set by the user. Instead it had platform
specific code that saved over the path.
Instead we just apply the user changes to the system environment.
Change-Id: I011f1a9d935c958265b2bda8257ad8611f06e578
Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/libs/utils/terminalinterface.cpp')
-rw-r--r-- | src/libs/utils/terminalinterface.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libs/utils/terminalinterface.cpp b/src/libs/utils/terminalinterface.cpp index 0d5a3be0203..45bdd8a4f9d 100644 --- a/src/libs/utils/terminalinterface.cpp +++ b/src/libs/utils/terminalinterface.cpp @@ -334,22 +334,12 @@ void TerminalInterface::start() Environment finalEnv = m_setup.m_environment; - if (HostOsInfo::isWindowsHost()) { - if (!finalEnv.hasKey("PATH")) { - const QString path = qtcEnvironmentVariable("PATH"); - if (!path.isEmpty()) - finalEnv.set("PATH", path); - } - if (!finalEnv.hasKey("SystemRoot")) { - const QString systemRoot = qtcEnvironmentVariable("SystemRoot"); - if (!systemRoot.isEmpty()) - finalEnv.set("SystemRoot", systemRoot); - } - } else if (HostOsInfo::isMacHost()) { + if (HostOsInfo::isMacHost()) finalEnv.set("TERM", "xterm-256color"); - } if (finalEnv.hasChanges()) { + finalEnv = finalEnv.appliedToEnvironment(Environment::systemEnvironment()); + d->envListFile = std::make_unique<QTemporaryFile>(this); if (!d->envListFile->open()) { cleanupAfterStartFailure(msgCannotCreateTempFile(d->envListFile->errorString())); |