void (final String @NotNull [] statements2execute) { if (handshake()) { ApplicationManager.getApplication().invokeLater(() -> { // Propagate console communication to language console final PythonConsoleView consoleView = myConsoleView; consoleView.setConsoleCommunication(myPydevConsoleCommunication); consoleView.setSdk(mySdk); consoleView.setExecutionHandler(myConsoleExecuteActionHandler); enableConsoleExecuteAction(); if (statements2execute.length == 1 && statements2execute[0].isEmpty()) { statements2execute[0] = "\t"; } for (String statement : statements2execute) { consoleView.executeStatement(statement + "\n", ProcessOutputTypes.SYSTEM); } setUserTypeRenderers(); fireConsoleInitializedEvent(consoleView); consoleView.initialized(); }); } else { myConsoleView.print(PyBundle.message("pydev.console.couldnt.connect.to.console.process"), ProcessOutputTypes.STDERR); myProcessHandler.destroyProcess(); myConsoleView.setEditable(false); } }