protected void bakeLine() {
		lineBuf.position(0);
		lineBuf.limit(guessEnd() + 1);
		lineBuf.put(lineBuf.limit() - 1, (byte) '\n');
		ByteBuffer temp = lineBaked;
		lineBaked = lineBuf;
		lineBuf = temp;
		lineBuf.clear();
		Arrays.fill(lineBuf.array(), (byte) 0);
		lineBuf.limit(0);
	}
There's not really a good way to know if any trailing space was intentional. For GDB/MI, that
doesn't really matter.
Ghidra/Framework/Pty/src/main/java/ghidra/pty/windows/AnsiBufferedInputStream.java