private void showOrHideNotification(@Nullable TerminalLineIntervalHighlighting commandHighlighting) {
    if (commandHighlighting == null || commandHighlighting.isDisposed()) {
      hideNotification();
      return;
    }
    if (myNotificationDisposable != null && !Disposer.isDisposed(myNotificationDisposable)) {
      return;
    }
    Disposable notificationDisposable = Disposer.newDisposable(myWidget.getTerminalPanel(), "terminal.smart_command_execution");
    String content = TerminalBundle.message("smart_command_execution.notification.text",
                                            KeymapUtil.getFirstKeyboardShortcutText(getRunAction()),
                                            KeymapUtil.getFirstKeyboardShortcutText(getDebugAction()));
    GotItTooltip tooltip = new GotItTooltip("terminal.smart_command_execution", content, notificationDisposable)
      .withHeader(TerminalBundle.message("smart_command_execution.notification.title"))
      .withLink(TerminalBundle.message("smart_command_execution.notification.configure_link.text"), () -> {
        ShowSettingsUtil.getInstance().showSettingsDialog(myWidget.getProject(), TerminalOptionsConfigurable.class);
      })
      .withPosition(Balloon.Position.below);
    if (!tooltip.canShow()) {
      Disposer.dispose(notificationDisposable);
      return;
    }
    tooltip.show(myWidget.getTerminalPanel(), (component, balloon) -> {
      Rectangle bounds = myWidget.processTerminalBuffer(buffer -> myWidget.getTerminalPanel().getBounds(commandHighlighting));
      if (bounds != null) {
        int shiftY = 0;
        if (balloon instanceof BalloonImpl &&
            BalloonImpl.getAbstractPositionFor(Balloon.Position.below) == ((BalloonImpl)balloon).getPosition()) {
          shiftY = bounds.height;
        }
        return new Point(bounds.x + bounds.width / 2, bounds.y + shiftY);
      }
      Disposer.dispose(notificationDisposable);
      return new Point(0, 0);
    });
    myNotificationDisposable = notificationDisposable;
  }
private void showOrHideNotification(@Nullable TerminalLineIntervalHighlighting commandHighlighting)