void (final @NotNull ToolWindow toolWindow) { myInitialized = true; myProject.getMessageBus().connect().subscribe(ToolWindowManagerListener.TOPIC, new ToolWindowManagerListener() { @Override public void toolWindowShown(@NotNull ToolWindow toolwindow) { ToolWindow window = getToolWindow(myProject); if (window.isVisible() && toolWindow.getContentManager().getContentCount() == 0) { PydevConsoleRunner runner = PythonConsoleRunnerFactory.getInstance().createConsoleRunner(myProject, null); runner.run(true); } } }); }