@Override
	public Terminal createWithStreams(Plugin helpPlugin, Charset charset, InputStream in,
			OutputStream out) {
		WritableByteChannel channel = Channels.newChannel(out);
		return new ThreadedTerminal(createProvider(helpPlugin, charset, buf -> {
			while (buf.hasRemaining()) {
				try {
					//ThreadedTerminal.printBuffer(">> ", buf);
					channel.write(buf);
				}
				catch (IOException e) {
					Msg.error(this, "Could not write terminal output: " + e);
				}
			}
		}), in);
	}
The plugin that provides {@link TerminalService}
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/TerminalPlugin.java