expose INTELLIJ_ENVIRONMENT_READER env var when loading shell env as TMUX env var has an illegal value

That will allow configuration shell scripts to check for its presense and skip some tool configuration (e.g. tmux from WEB-27433)
IDEA-CR-22283
This commit is contained in:
Sergey Simonchik
2017-06-26 17:38:22 +03:00
parent e095ae91d5
commit 9dcc2e8aaf
@@ -153,7 +153,7 @@ public class EnvironmentUtil {
}
private static final String DISABLE_OMZ_AUTO_UPDATE = "DISABLE_AUTO_UPDATE";
private static final String TMUX = "TMUX";
private static final String INTELLIJ_ENVIRONMENT_READER = "INTELLIJ_ENVIRONMENT_READER";
private static Map<String, String> getShellEnv() throws Exception {
return new ShellEnvReader().readShellEnv();
@@ -220,7 +220,7 @@ public class EnvironmentUtil {
}
if (workingDir != null) builder.directory(workingDir);
builder.environment().put(DISABLE_OMZ_AUTO_UPDATE, "true");
builder.environment().put(TMUX, "disabled by IntelliJ");
builder.environment().put(INTELLIJ_ENVIRONMENT_READER, "true");
Process process = builder.start();
StreamGobbler gobbler = new StreamGobbler(process.getInputStream());
int rv = waitAndTerminateAfter(process, SHELL_ENV_READING_TIMEOUT);
@@ -257,7 +257,7 @@ public class EnvironmentUtil {
@NotNull
private static Map<String, String> parseEnv(String text, String lineSeparator) throws Exception {
Set<String> toIgnore = new HashSet<String>(Arrays.asList("_", "PWD", "SHLVL", DISABLE_OMZ_AUTO_UPDATE, TMUX));
Set<String> toIgnore = new HashSet<String>(Arrays.asList("_", "PWD", "SHLVL", DISABLE_OMZ_AUTO_UPDATE, INTELLIJ_ENVIRONMENT_READER));
Map<String, String> env = System.getenv();
Map<String, String> newEnv = new HashMap<String, String>();