static @NotNull String getText(@NotNull TerminalPanel terminalPanel) {
    TerminalTextBuffer buffer = terminalPanel.getTerminalTextBuffer();
    buffer.lock();
    try {
      TerminalSelection selection = new TerminalSelection(
        new Point(0, -buffer.getHistoryLinesCount()),
        new Point(buffer.getWidth(), buffer.getScreenLinesCount() - 1));
      Pair<Point, Point> points = selection.pointsForRun(buffer.getWidth());
      return SelectionUtil.getSelectionText(points.getFirst(), points.getSecond(), buffer);
    }
    finally {
      buffer.unlock();
    }
  }
static @NotNull String getText(@NotNull TerminalPanel terminalPanel)