[eel] IJPL-213853 Minimal environment variables on local Eel must not include login-interactive variables

GitOrigin-RevId: 10134ef0c5214b43fc7e6988ba841d91f3e2fc1e
This commit is contained in:
Vladimir Lagunov
2025-10-20 19:22:40 +00:00
committed by intellij-monorepo-bot
parent 557227bfb9
commit 589309f4ae
2 changed files with 4 additions and 7 deletions
@@ -64,9 +64,7 @@ class EelLocalExecPosixApi(
val (cache, interactive) = when (opts.mode) {
EelExecPosixApi.PosixEnvironmentVariablesOptions.Mode.MINIMAL -> {
return service<CoroutineScopeService>().coroutineScope.async {
EnvironmentUtil.getEnvironmentMap()
}
return CompletableDeferred(EnvironmentUtil.getSystemEnv())
}
EelExecPosixApi.PosixEnvironmentVariablesOptions.Mode.LOGIN_NON_INTERACTIVE -> {
@@ -200,9 +198,7 @@ class EelLocalExecWindowsApi : EelExecWindowsApi, LocalEelExecApi {
override val descriptor: EelDescriptor = LocalEelDescriptor
override fun environmentVariables(opts: EelExecApi.EnvironmentVariablesOptions): Deferred<Map<String, String>> =
service<CoroutineScopeService>().coroutineScope.async {
EnvironmentUtil.getEnvironmentMap()
}
CompletableDeferred(EnvironmentUtil.getEnvironmentMap())
override suspend fun findExeFilesInPath(binaryName: String): List<EelPath> =
findExeFilesInPath(binaryName, LOG)
@@ -112,7 +112,8 @@ public final class EnvironmentUtil {
ourEnvGetter.set(loader);
}
private static Map<String, String> getSystemEnv() {
@ApiStatus.Internal
public static Map<String, String> getSystemEnv() {
if (OS.CURRENT == OS.Windows) {
return Collections.unmodifiableMap(CollectionFactory.createCaseInsensitiveStringMap(System.getenv()));
}