String (@NotNull Project project) { PythonConsoleToolWindow toolWindow = PythonConsoleToolWindow.getInstance(project); ToolWindow window = toolWindow.getToolWindow(); final Content content = window.getContentManager().getSelectedContent(); if (content == null) return null; return content.getDisplayName(); }