Fix conda auto-activation for bash (PY-23417)

This commit is contained in:
Dmitry Trofimov
2018-11-09 00:14:13 +01:00
parent 6f00c0e0ae
commit b9945804d0
8 changed files with 75 additions and 29 deletions

View File

@@ -39,14 +39,17 @@ class PyVirtualEnvTerminalCustomizer : LocalTerminalCustomizer() {
val shellName = File(shellPath).name
if (shellName == "bash" || (SystemInfo.isMac && shellName == "sh") || (shellName == "zsh") ||
((shellName == "fish") && PythonSdkType.isVirtualEnv(sdk))) { //fish shell works only for virtualenv and not for conda
((shellName == "fish"))) { //fish shell works only for virtualenv and not for conda
//for bash we pass activate script to jediterm shell integration (see jediterm-bash.in) to source it there
//TODO: fix conda for fish
findActivateScript(path, shellPath)?.let { activate ->
val pathEnv = EnvironmentUtil.getEnvironmentMap().get("PATH")
if (pathEnv != null) {
envs.put("PATH", pathEnv)
}
envs.put("JEDITERM_SOURCE", if (activate.second != null) "${activate.first} ${activate.second}" else activate.first)
envs.put("JEDITERM_SOURCE", activate.first)
envs.put("JEDITERM_SOURCE_ARGS", activate.second?:"")
}
}
else {