void (@NotNull RunContentBuilder contentBuilder, @NotNull ExecutionResult executionResult, boolean isJavaCommandLine) { final ExecutionConsole executionConsole = executionResult.getExecutionConsole(); final JComponent consoleComponent = executionConsole != null ? executionConsole.getComponent() : null; ProcessHandler processHandler = executionResult.getProcessHandler(); assert processHandler != null : executionResult; final ControlBreakAction controlBreakAction = new ControlBreakAction(); if (consoleComponent != null) { controlBreakAction.registerCustomShortcutSet(controlBreakAction.getShortcutSet(), consoleComponent); processHandler.addProcessListener(new ProcessAdapter() { @Override public void processTerminated(@NotNull final ProcessEvent event) { processHandler.removeProcessListener(this); controlBreakAction.unregisterCustomShortcutSet(consoleComponent); } }); } if (isJavaCommandLine) { AttachDebuggerAction.add(contentBuilder, processHandler); } }