private @Nullable TerminalLineIntervalHighlighting highlightCommandIfMatched(@NotNull Project project, @NotNull String command) {
    if (command.isEmpty()) {
      myLastSmartCommandContext = null;
      return null;
    }
    String workingDirectory = getWorkingDirectory();
    boolean localSession = !hasRunningCommands();
    TerminalShellCommandHandler handler = ContainerUtil.find(TerminalShellCommandHandler.Companion.getEP().getExtensionList(),
                                                             it -> it.matches(project, workingDirectory, localSession, command));
    if (handler == null) {
      myLastSmartCommandContext = null;
      return null;
    }
    TerminalLineIntervalHighlighting highlighting = myWidget.processTerminalBuffer(textBuffer -> {
      int cursorLine = myWidget.getLineNumberAtCursor();
      if (cursorLine < 0 || cursorLine >= textBuffer.getHeight()) {
        return null;
      }
      String lineText = textBuffer.getLine(cursorLine).getText();
      int commandStartInd = lineText.lastIndexOf(command);
      if (commandStartInd < 0) {
        return null;
      }
      TextStyle textStyle = getSmartCommandExecutionStyle();
      if (textStyle == null) {
        return null;
      }
      return myWidget.highlightLineInterval(cursorLine, commandStartInd, command.length(), textStyle);
    });
    if (highlighting != null) {
      myLastSmartCommandContext = new SmartCommandContext(handler, myWidget.getTtyConnector(),
                                                          project, workingDirectory, localSession, command);
    }
    else {
      myLastSmartCommandContext = null;
    }
    return highlighting;
  }
private @Nullable TerminalLineIntervalHighlighting highlightCommandIfMatched(@NotNull Project project, @NotNull String command)