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.
This commit is contained in:
Dmitry Trofimov
2016-10-18 20:17:06 +02:00
parent 5ec562fdd8
commit 59bbcccc61
@@ -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()
}