PythonDebugConsoleCommunication (@NotNull PythonConsoleView pythonConsoleView, @NotNull PydevDebugConsoleExecuteActionHandler consoleExecuteActionHandler, @NotNull PyDebugProcess debugProcess, @NotNull ProcessHandler processHandler, @NotNull PythonDebugConsoleCommunication debugConsoleCommunication, final XDebugSession session) { pythonConsoleView.setExecutionHandler(consoleExecuteActionHandler); debugProcess.getSession().addSessionListener(consoleExecuteActionHandler); new LanguageConsoleBuilder(pythonConsoleView).processHandler(processHandler).initActions(consoleExecuteActionHandler, "py", true); debugConsoleCommunication.addCommunicationListener(new ConsoleCommunicationListener() { @Override public void commandExecuted(boolean more) { session.rebuildViews(); } @Override public void inputRequested() { ApplicationManager.getApplication().invokeLater(() -> { if (session.getConsoleView() instanceof PythonDebugLanguageConsoleView debugConsoleView) { selectConsoleTab(session.getRunContentDescriptor(), session.getUI().getContentManager(), true); if (pythonConsoleView.isVisible()) { requestFocus(true, null, pythonConsoleView, true); } else if (debugConsoleView.getPrimaryConsoleView() instanceof ConsoleViewImpl consoleView) { requestFocus(false, consoleView.getEditor(), null, true); } } }); } }); return debugConsoleCommunication; }