void () { ConsoleViewImpl mainConsoleView = getMainConsoleView(); if (mainConsoleView != null) { ProcessHandler handler = myDescriptor.getProcessHandler(); String addressDisplayName = ""; DebugProcess debugProcess = DebuggerManager.getInstance(myProject).getDebugProcess(handler); if (debugProcess instanceof DebugProcessImpl) { addressDisplayName = "(" + JavaDebuggerBundle.getAddressDisplayName(((DebugProcessImpl)debugProcess).getConnection()) + ")"; } String statusText = ExternalSystemBundle.message("debugger.status.connected", myProcessName, addressDisplayName); String linkText = ExternalSystemBundle.message("debugger.open.session.tab"); String debuggerAttachedStatusMessage = statusText + " " + linkText + '\n'; mainConsoleView.print(debuggerAttachedStatusMessage, ConsoleViewContentType.SYSTEM_OUTPUT); mainConsoleView.performWhenNoDeferredOutput(() -> { EditorHyperlinkSupport hyperlinkSupport = mainConsoleView.getHyperlinks(); int messageOffset = mainConsoleView.getText().indexOf(debuggerAttachedStatusMessage); int linkStartOffset = messageOffset + debuggerAttachedStatusMessage.indexOf(linkText); myHyperlink = hyperlinkSupport.createHyperlink(linkStartOffset, linkStartOffset + linkText.length(), null, project -> { // open tab final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject); ContentManager contentManager = toolWindowManager.getToolWindow(ToolWindowId.DEBUG).getContentManager(); Content content = myDescriptor.getAttachedContent(); if (content != null) { contentManager.setSelectedContent(content, true, true); } }); }); } }