From 4f3f60dc830e4774499d4f46d804cc66dddae008 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Wed, 25 Jan 2017 13:20:16 +0300 Subject: [PATCH 1/2] IDEA-167089 MacOSX: support tcsh shell for loading environment variables --- .../util/src/com/intellij/util/EnvironmentUtil.java | 13 ++++++++++--- .../com/jetbrains/python/run/PyVirtualEnvReader.kt | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) 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()) { From b85e71877a1645a61e3bb412b0d98b601c795858 Mon Sep 17 00:00:00 2001 From: "Evgeniy.Stepanov" Date: Wed, 25 Jan 2017 10:40:36 +0100 Subject: [PATCH 2/2] Fix merging TreeUpdatePasses in ui tree --- .../com/intellij/ide/util/treeView/AbstractTreeUpdater.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUpdater.java b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUpdater.java index 51f19ca9af61..94703985380a 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUpdater.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUpdater.java @@ -127,7 +127,9 @@ public class AbstractTreeUpdater implements Disposable, Activatable { for (Iterator iterator = myNodeQueue.iterator(); iterator.hasNext();) { final TreeUpdatePass passInQueue = iterator.next(); - if (toAdd.isUpdateStructure() == passInQueue.isUpdateStructure()) { + boolean isMatchingPass = + toAdd.isUpdateStructure() == passInQueue.isUpdateStructure() && toAdd.isUpdateChildren() == passInQueue.isUpdateChildren(); + if (isMatchingPass) { if (passInQueue == toAdd) { toAdd.expire(); break;