void (@NotNull String processName, @NotNull Socket socket, @NotNull DataInputStream inputStream) { ApplicationManager.getApplication().invokeLater(() -> { final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject); ToolWindow window = toolWindowManager.getToolWindow(ToolWindowId.DEBUG); if (window != null) { ContentManager contentManager = window.getContentManager(); Content content = contentManager.findContent(processName); if (content != null) { RunContentDescriptor descriptor = content.getUserData(RunContentDescriptor.DESCRIPTOR_KEY); if (descriptor != null) { ProcessHandler handler = descriptor.getProcessHandler(); if (handler != null) { handler.destroyProcess(); } } } } unblockRemote(socket, inputStream); }); }