diff --git a/platform/util/src/com/intellij/util/EnvironmentUtil.java b/platform/util/src/com/intellij/util/EnvironmentUtil.java index 536954029bc7..079832d33f68 100644 --- a/platform/util/src/com/intellij/util/EnvironmentUtil.java +++ b/platform/util/src/com/intellij/util/EnvironmentUtil.java @@ -27,6 +27,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.CharsetToolkit; import com.intellij.util.concurrency.AppExecutorUtil; import com.intellij.util.concurrency.FixedFuture; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.io.BaseOutputReader; import com.intellij.util.text.CaseInsensitiveStringHashingStrategy; import gnu.trove.THashMap; @@ -210,14 +211,20 @@ public class EnvironmentUtil { return parseEnv(lines, lineSeparator); } + @NotNull protected List getShellProcessCommand() throws Exception { String shell = getShell(); - if (shell == null || !new File(shell).canExecute()) { throw new Exception("shell:" + shell); } - - return new ArrayList(Arrays.asList(shell, "-l", "-i")); + List commands = ContainerUtil.newArrayList(shell); + if (!shell.endsWith("/tcsh")) { + // Act as a login shell + // tsch does allow to use -l with any other options + commands.add("-l"); + } + commands.add("-i"); // enable interactive shell + return commands; } @Nullable diff --git a/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt b/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt index 792bcc794ab0..e0e6c1dd5f55 100644 --- a/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt +++ b/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt @@ -86,7 +86,7 @@ class PyVirtualEnvReader(val virtualEnvSdkPath: String) : EnvironmentUtil.ShellE } - override fun getShellProcessCommand(): MutableList? { + override fun getShellProcessCommand(): MutableList { val shellPath = shell if (shellPath == null || !File(shellPath).canExecute()) {