EelLocalExecApi: Inherit env vars by default.

Lackage of `PATH` breaks many tools including python

GitOrigin-RevId: a522f6afaa8f94dc18ae2151833b2f9e69172bc5
This commit is contained in:
Ilya.Kazakevich
2024-10-05 00:17:03 +02:00
committed by intellij-monorepo-bot
parent 845656d8e2
commit c2a06caab3

View File

@@ -18,11 +18,13 @@ class EelLocalExecApi : EelExecApi {
val process: LocalEelProcess =
try {
// Inherit env vars, because lack of `PATH` might break things
val environment = System.getenv() + builder.env
if (pty != null) {
LocalEelProcess(PtyProcessBuilder()
.setConsole(true)
.setCommand(arrayOf(builder.exe) + args)
.setEnvironment(builder.env)
.setEnvironment(environment)
.setDirectory(builder.workingDirectory)
.setInitialColumns(pty.columns)
.setInitialRows(pty.rows)
@@ -30,7 +32,7 @@ class EelLocalExecApi : EelExecApi {
}
else {
LocalEelProcess(ProcessBuilder(builder.exe, *args).apply {
environment().putAll(builder.env)
environment().putAll(environment)
builder.workingDirectory?.let {
directory(File(it))
}