static @Nullable String getSelectedText(@NotNull TerminalPanel terminalPanel) {
    TerminalSelection selection = terminalPanel.getSelection();
    if (selection == null) return null;
    TerminalTextBuffer buffer = terminalPanel.getTerminalTextBuffer();
    buffer.lock();
    try {
      Pair<Point, Point> points = selection.pointsForRun(buffer.getWidth());
      return SelectionUtil.getSelectionText(points.getFirst(), points.getSecond(), buffer);
    }
    finally {
      buffer.unlock();
    }
  }
static @Nullable String getSelectedText(@NotNull TerminalPanel terminalPanel)