@Override
  public void update(@NotNull AnActionEvent event) {
    super.update(event);
    ConsoleView consoleView = getConsoleView(event);

    boolean isEnabled;
    if (consoleView == null || !consoleView.canPause()) {
      isEnabled = false;
    }
    else {
      RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(event.getDataContext());
      ProcessHandler handler = descriptor != null ? descriptor.getProcessHandler() : null;
      isEnabled = handler != null && !handler.isProcessTerminated() ||
                  consoleView.hasDeferredOutput();
    }

    Presentation presentation = event.getPresentation();
    presentation.setEnabledAndVisible(isEnabled);
  }
@Override
  public void update(@NotNull AnActionEvent event)