private @NotNull XDebugSession createXDebugSession(@NotNull ExecutionEnvironment environment,
                                                     PythonCommandLineState pyState,
                                                     ServerSocket serverSocket, ExecutionResult result) throws ExecutionException {
    XDebugSession session = XDebuggerManager.getInstance(environment.getProject()).
      startSession(environment, new XDebugProcessStarter() {
        @Override
        public @NotNull XDebugProcess start(final @NotNull XDebugSession session) {
          PyDebugProcess pyDebugProcess = createDebugProcess(session, serverSocket, result, pyState);

          createConsoleCommunicationAndSetupActions(environment.getProject(), result, pyDebugProcess, session);
          return pyDebugProcess;
        }
      });

    if (ExperimentalUI.isNewUI()) {
      session.getUI().getDefaults().initContentAttraction(DebuggerContentInfo.CONSOLE_CONTENT,
                                                          XDebuggerUIConstants.LAYOUT_VIEW_FINISH_CONDITION,
                                                          new LayoutAttractionPolicy.FocusOnce());
    }
    return session;
  }
private @NotNull XDebugSession createXDebugSession(@NotNull ExecutionEnvironment environment,
                                                     PythonCommandLineState pyState,
                                                     ServerSocket serverSocket, ExecutionResult result)