static void printBuffer(String prefix, ByteBuffer bb) {
		byte[] bytes = new byte[bb.remaining()];
		bb.get(bb.position(), bytes);
		System.err.print(prefix);
		try {
			String str = new String(bytes, "US-ASCII");
			for (char c : str.toCharArray()) {
				if (c == 0x1b) {
					System.err.print("\n\\x1b");
				}
				else if (c < ' ' || c > '\u007f') {
					System.err.print("\\x%02x".formatted((int) c));
				}
				else {
					System.err.print(c);
				}
			}
			System.err.println();
		}
		catch (UnsupportedEncodingException e) {
			System.err.println("Couldn't decode");
		}
	}
Construct a terminal connected to the given input stream

@param provider the provider
@param in the input stream
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/ThreadedTerminal.java