@ApiStatus.Internal
  public @NotNull Process startProcessWithPty(@NotNull List<String> commands) throws IOException {
    Map<String, String> env = new HashMap<>();
    setupEnvironment(env);
    if (!SystemInfo.isWindows) {
      // Let programs know about the emulator's capabilities to allow them to produce appropriate escape sequences.
      // https://www.gnu.org/software/gettext/manual/html_node/The-TERM-variable.html
      // Moreover, some programs require `$TERM` to be set, e.g. `/usr/bin/clear` or Python code `os.system("clear")`.
      // The following error will be reported if `$TERM` is missing: "TERM environment variable set not set."
      if (!getEnvironment().containsKey("TERM")) {
        env.put("TERM", "xterm-256color");
      }
    }

    String[] command = ArrayUtilRt.toStringArray(commands);
    File workDirectory = getWorkDirectory();
    String directory = workDirectory != null ? workDirectory.getPath() : null;
    LocalPtyOptions options = getPtyOptions();
    Application app = ApplicationManager.getApplication();
    return ProcessService.getInstance()
      .startPtyProcess(command, directory, env, options, app, isRedirectErrorStream(), myWindowsAnsiColorEnabled, myUnixOpenTtyToPreserveOutputAfterTermination);
  }
@ApiStatus.Internal
  public @NotNull Process startProcessWithPty(@NotNull List<String> commands)