@Override
  public final void update(@NotNull AnActionEvent e) {
    EditorEx editor = myConsoleView.getConsoleEditor();
    editor = (EditorEx) ClientEditorManager.getClientEditor(editor, ClientId.getCurrentOrNull());
    boolean enabled = !editor.isRendererMode() && isEnabled() &&
                      (myExecuteActionHandler.isEmptyCommandExecutionAllowed() || !StringUtil.isEmptyOrSpaces(editor.getDocument().getCharsSequence()));
    if (enabled) {
      Lookup lookup = LookupManager.getActiveLookup(editor);
      // we should check getCurrentItem() also - fast typing could produce outdated lookup, such lookup reports isCompletion() true
      enabled = lookup == null || !lookup.isCompletion() || lookup.getCurrentItem() == null ||
                lookup instanceof LookupImpl && ((LookupImpl)lookup).getLookupFocusDegree() == LookupFocusDegree.UNFOCUSED;
    }

    e.getPresentation().setEnabled(enabled);
  }
@Override
  public final void update(@NotNull AnActionEvent e)