From 59bbcccc61093a6f4e2142b0594eddeb1bad0cde Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Tue, 18 Oct 2016 20:17:06 +0200 Subject: [PATCH] For some strange reason bash doesn't pass env variables sourced from rcfile to the command in case of non-interactive mode. Interactive mode can crash the process, so it is not an option. The only option left is to use composite command that sources the activate script and then prints envs. And this works both for bash and sh on Linux. --- python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt b/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt index 2e2605916065..ad77c7df9e20 100644 --- a/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt +++ b/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt @@ -85,12 +85,7 @@ class PyVirtualEnvReader(val virtualEnvSdkPath: String) : EnvironmentUtil.ShellE } return if (activate != null) - if (File(shellPath).name == "bash") { - mutableListOf(shellPath, "--rcfile", activate) - } - else { - mutableListOf(shellPath, "-c", "source '$activate'") - } + mutableListOf(shellPath, "-c", "source '$activate'") else super.getShellProcessCommand() }