void () { 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); } } }); }