protected @Nullable Pair<Content, TerminalWidget> getSuitableProcess(@NotNull Project project,
                                                                       @NotNull Content content,
                                                                       @NotNull String workingDirectory) {
    TerminalWidget widget = TerminalToolWindowManager.findWidgetByContent(content);
    if (widget == null || (widget instanceof JBTerminalWidget && !(widget instanceof ShellTerminalWidget))) {
      return null;
    }

    if (widget instanceof ShellTerminalWidget shellTerminalWidget && !shellTerminalWidget.getTypedShellCommand().isEmpty()) {
      return null;
    }

    ProcessTtyConnector processTtyConnector = ShellTerminalWidget.getProcessTtyConnector(widget.getTtyConnector());
    if (processTtyConnector == null || TerminalUtil.hasRunningCommands(processTtyConnector)) {
      return null;
    }

    String currentWorkingDirectory = TerminalWorkingDirectoryManager.getWorkingDirectory(widget);
    if (!FileUtil.pathsEqual(workingDirectory, currentWorkingDirectory)) {
      return null;
    }

    return new Pair<>(content, widget);
  }
protected @Nullable Pair<Content, TerminalWidget> getSuitableProcess(@NotNull Project project,
                                                                       @NotNull Content content,
                                                                       @NotNull String workingDirectory)