public boolean resize(int cols, int rows) {
		cols = Math.max(1, cols);
		rows = Math.max(1, rows);

		if (this.rows == rows && this.cols == cols) {
			return false;
		}

		for (VtLine line : scrollBack) {
			line.resize(cols);
		}
		for (VtLine line : lines) {
			line.resize(cols);
		}
		this.rows = rows;
		this.cols = cols;
		this.scrollStart = 0;
		this.scrollEnd = rows;

		while (lines.size() < rows) {
			lines.add(0, scrollBack.isEmpty() ? new VtLine(cols) : scrollBack.pollLast());
			curY++;
			savedY++;
		}
		while (lines.size() > rows) {
			scrollBack.addLast(lines.remove(0));
			curY--;
			savedY--;
		}
		while (scrollBack.size() > maxScrollBack) {
			scrollBack.pollFirst();
		}

		curX = Math.min(curX, cols - 1);
		savedX = Math.min(savedX, cols - 1);

		curY = Math.max(0, Math.min(curY, rows - 1));
		savedY = Math.max(0, Math.min(savedY, rows - 1));

		return true;
	}
Resize the buffer to the given number of rows and columns

<p>
The viewport is reset to include the full display. Each line, including those in the
scroll-back buffer are resized to match the requested number of columns. If the row count is
decreasing, lines at the top of the display are be shifted into the scroll-back buffer. If
the row count is increasing, lines at the bottom of the scroll-back buffer are shifted into
the display buffer. The scroll-back buffer may be culled if the resulting number of lines
exceeds that scroll-back maximum. The cursor position is adjusted so that, if possible, it
remains on the same line. (The cursor cannot enter the scroll-back region.) Finally, the
cursor is clamped into the display region. The saved cursor, if applicable, is similarly
treated.

@param cols the number of columns
@param rows the number of rows
@return true if the buffer was actually resized
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/vt/VtBuffer.java