protected void pump() {
		while (!closed) {
			try {
				if (-1 == in.read(buffer) || closed) {
					return;
				}
				buffer.flip();
				//printBuffer("<< ", buffer);
				synchronized (buffer) {
					provider.processInput(buffer);
				}
				buffer.clear();
			}
			catch (IOException e) {
				Msg.error(this, "Console input closed unexpectedly: " + e);
				closed = true;
				return;
			}
			catch (Exception e) {
				Msg.error(this, "Unexpected error processing terminal input", e);
				continue;
			}
		}
	}
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