@Override
	public int waitExited(long timeout, TimeUnit unit)
			throws InterruptedException, TimeoutException {
		if (!process.waitFor(timeout, unit)) {
			throw new TimeoutException();
		}
		return process.exitValue();
	}
A pty session consisting of a local process and its descendants
Ghidra/Framework/Pty/src/main/java/ghidra/pty/local/LocalProcessPtySession.java