protected int guessEnd() {
		for (int i = lineBuf.limit() - 1; i >= 0; i--) {
			byte c = lineBuf.get(i);
			if (c != 0x20 && c != 0) {
				return i + 1;
			}
		}
		return 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