public String getText(int startRow, int startCol, int endRow, int endCol,
			CharSequence lineSep) {
		StringBuilder buf = new StringBuilder();
		int sbSize = scrollBack.size();
		if (startRow < sbSize) {
			int i = 0;
			for (VtLine line : scrollBack) {
				if (gatherLineText(buf, startRow, startCol, endRow, endCol, i, line, lineSep)) {
					break;
				}
				i++;
			}
		}
		int lnSize = lines.size();
		for (int i = Math.max(sbSize, startRow); i <= Math.min(endRow, sbSize + lnSize - 1); i++) {
			VtLine line = lines.get(i - sbSize);
			gatherLineText(buf, startRow, startCol, endRow, endCol, i, line, lineSep);
		}
		return buf.toString();
	}
Get the text between two locations in the buffer

<p>
The buffer attempts to avoid extraneous space at the end of each line. This isn't always
perfect and depends on how lines are cleared. If they are cleared using
{@link #erase(Erasure)}, then the buffer will cull the trailing spaces resulting from the
clear. If they are cleared using {@link #putChar(char)} passing a space {@code ' '}, then the
inserted spaces will be included. In practice, this depends on the application controlling
the terminal.

<p>
Like the other methods, locations are specified 0 up, top to bottom, and left to right.
Unlike the other methods, the ending character is excluded from the result.

@param startRow the row for the starting location, inclusive
@param startCol the column for the starting location, inclusive
@param endRow the row for the ending location, inclusive
@param endCol the column for the ending location, <em>exclusive</em>
@param lineSep the line separator
@return the text
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/vt/VtBuffer.java