protected void doCleanTerminated() {
		for (TerminalProvider provider : List.copyOf(providers)) {
			if (provider.isTerminated()) {
				provider.removeFromTool();
			}
		}
	}
The plugin that provides {@link TerminalService}
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/TerminalPlugin.java