Take ZDOTDIR value from EnvironmentUtil.getEnvironmentMap() (IDEA-162571)
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Fri, 11 Nov 2016 10:30:04 +0000 (11:30 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Fri, 11 Nov 2016 10:30:04 +0000 (11:30 +0100)
plugins/terminal/src/org/jetbrains/plugins/terminal/LocalTerminalDirectRunner.java

index 92acaac7586a565a56da60f4d7686b03436fa463..a617c35dd438d43781a654f8edd04dafa1830990 100644 (file)
@@ -198,8 +198,9 @@ public class LocalTerminalDirectRunner extends AbstractTerminalRunner<PtyProcess
             addRcFileArgument(envs, command, result, rcFilePath, "--rcfile");
           }
           else if (shellName.equals("zsh")) {
-            if (StringUtil.isNotEmpty(EnvironmentUtil.getEnvironmentMap().get(ZDOTDIR))) {
-              File zshRc = new File(FileUtil.expandUserHome(envs.get(ZDOTDIR)), ".zshrc");
+            String zdotdir = EnvironmentUtil.getEnvironmentMap().get(ZDOTDIR);
+            if (StringUtil.isNotEmpty(zdotdir)) {
+              File zshRc = new File(FileUtil.expandUserHome(zdotdir), ".zshrc");
               if (zshRc.exists()) {
                 envs.put(JEDITERM_USER_RCFILE, zshRc.getAbsolutePath());
               }