protected final @NotNull Map.Entry<String, Map<String, String>> runProcessAndReadOutputAndEnvs(@NotNull List<String> command,
                                                                                                   @Nullable Path workingDir,
                                                                                                   @NotNull Consumer<? super @NotNull Map<String, String>> scriptEnvironmentProcessor,
                                                                                                   @NotNull Path envDataFile) throws IOException {
      final ProcessBuilder builder = new ProcessBuilder(command);

      /*
       * Add, remove or change the environment variables.
       */
      scriptEnvironmentProcessor.accept(builder.environment());

      if (workingDir != null) {
        builder.directory(workingDir.toFile());
      }
      builder.environment().put(DISABLE_OMZ_AUTO_UPDATE, "true");
      builder.environment().put(INTELLIJ_ENVIRONMENT_READER, "true");

      Path logFile = Files.createTempFile("ij-shell-env-log.", ".tmp");
      try {
        Process process = builder
          .redirectErrorStream(true)
          .redirectOutput(ProcessBuilder.Redirect.to(logFile.toFile()))
          .start();
        int exitCode = waitAndTerminateAfter(process, myTimeoutMillis);

        String envData = Files.exists(envDataFile) ? new String(Files.readAllBytes(envDataFile), Charset.defaultCharset()) : "";
        String log = Files.exists(logFile) ? new String(Files.readAllBytes(logFile), Charset.defaultCharset()) : "(no log file)";
        if (exitCode != 0 || envData.isEmpty()) {
          if (!log.isEmpty()) {
            LOG.info("stdout/stderr: " + log);
          }
          throw new EnvironmentReaderException("command " + command + ", exit code: " + exitCode, envData, log);
        }
        return new AbstractMap.SimpleImmutableEntry<>(log, parseEnv(envData));
      }
      finally {
        deleteTempFile(logFile);
      }
    }
protected final @NotNull Map.Entry<String, Map<String, String>> runProcessAndReadOutputAndEnvs(@NotNull List<String> command,
                                                                                                   @Nullable Path workingDir,
                                                                                                   @NotNull Consumer<? super @NotNull Map<String, String>> scriptEnvironmentProcessor,
                                                                                                   @NotNull Path envDataFile)