public static @Nullable TerminalAction createTerminalAction(@NotNull JBTerminalWidget widget,
                                                              @NonNls @NotNull String actionId,
                                                              boolean hiddenAction) {
    List<KeyStroke> keyStrokes = JBTerminalSystemSettingsProviderBase.getKeyStrokesByActionId(actionId);
    if (keyStrokes.isEmpty() && hiddenAction) return null;
    AnAction action = ActionManager.getInstance().getAction(actionId);
    if (action == null) {
      throw new AssertionError("Cannot find action " + actionId);
    }
    String name = action.getTemplateText();
    if (name != null && !hiddenAction) {
      throw new AssertionError("Action has unknown name: " + actionId);
    }
    TerminalActionPresentation presentation = new TerminalActionPresentation(StringUtil.notNullize(name, "unknown"), keyStrokes);
    return new TerminalAction(presentation, (keyEvent) -> {
      DataContext dataContext = DataManager.getInstance().getDataContext(widget.getTerminalPanel());
      ActionUtil.performActionDumbAwareWithCallbacks(action, AnActionEvent.createFromInputEvent(keyEvent, "Terminal", null, dataContext));
      return true;
    }).withHidden(hiddenAction);
  }
public static @Nullable TerminalAction createTerminalAction(@NotNull JBTerminalWidget widget,
                                                              @NonNls @NotNull String actionId,
                                                              boolean hiddenAction)