Save and restore the old value of XDG_CONFIG_HOME (IDEA-165495)
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 15 Dec 2016 15:49:56 +0000 (16:49 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 15 Dec 2016 15:51:12 +0000 (16:51 +0100)
plugins/terminal/resources/fish/config.fish
plugins/terminal/src/org/jetbrains/plugins/terminal/LocalTerminalDirectRunner.java

index ae0e041048fa07119cee8d6548d2aa642d12a0e5..caf0197c48d4b8d0fe1a8e46f047e286c08de89f 100644 (file)
@@ -1,3 +1,7 @@
+if test -n "$OLD_XDG_CONFIG_HOME"
+  set XDG_CONFIG_HOME "$OLD_XDG_CONFIG_HOME"
+end
+
 if test -f ~/.config/fish/config.fish
   . ~/.config/fish/config.fish
 end
index e662327d989ba0be0b6a7a7cc4a8a2b1f3fcfbcc..8569af01950e18c14c22507276819cd5a3e95fae 100644 (file)
@@ -216,6 +216,7 @@ public class LocalTerminalDirectRunner extends AbstractTerminalRunner<PtyProcess
               if (fishConfig.exists()) {
                 envs.put(JEDITERM_USER_RCFILE, fishConfig.getAbsolutePath());
               }
+              envs.put("OLD_" + XDG_CONFIG_HOME, xdgConfig);
             }
 
             envs.put(XDG_CONFIG_HOME, new File(rcFilePath).getParentFile().getParent());