@Override
  public @Nullable ExecutionResult execute(Executor executor,
                                           PythonProcessStarter processStarter,
                                           CommandLinePatcher... patchers) throws ExecutionException {
    Project project = myConfig.getProject();

    if (myConfig.showCommandLineAfterwards() && !emulateTerminal()) {
      if (!DefaultDebugExecutor.EXECUTOR_ID.equals(executor.getId()) && !DefaultRunExecutor.EXECUTOR_ID.equals(executor.getId())) {
        // disable "Show command line" for all executors except of Run and Debug, because it's useless
        return super.execute(executor, processStarter, patchers);
      }

      PyRunFileInConsoleAction.configExecuted(myConfig);

      if (DefaultDebugExecutor.EXECUTOR_ID.equals(executor.getId())) {
        return super.execute(executor, processStarter, ArrayUtil.append(patchers, new CommandLinePatcher() {
          @Override
          public void patchCommandLine(GeneralCommandLine commandLine) {
            commandLine.getParametersList().getParamsGroup(PythonCommandLineState.GROUP_DEBUGGER).addParameterAt(1, "--cmd-line");
          }
        }));
      }

      final String runFileText = PythonConsoleScripts.buildScriptWithConsoleRun(myConfig);
      final boolean useExistingConsole = PyConsoleOptions.getInstance(project).isUseExistingConsole();
      ApplicationManager.getApplication().invokeLater(() -> {
        PyExecuteInConsole.executeCodeInConsole(project, runFileText, null, useExistingConsole, false, true, myConfig);
      });
      return null;
    }
    else if (emulateTerminal()) {
      setRunWithPty(true);

      final ProcessHandler processHandler = startProcess(processStarter, patchers);

      TerminalExecutionConsole executeConsole = createTerminalExecutionConsole(myConfig.getProject(), processHandler);

      processHandler.startNotify();

      return new DefaultExecutionResult(executeConsole, processHandler, AnAction.EMPTY_ARRAY);
    }
    else {
      ExecutionResult executionResult = super.execute(executor, processStarter, patchers);
      if (myConfig.isRedirectInput()) {
        addInputRedirectionMessage(project, executionResult);
      }
      return executionResult;
    }
  }
@Override
  public @Nullable ExecutionResult execute(Executor executor,
                                           PythonProcessStarter processStarter,
                                           CommandLinePatcher... patchers)