public void setTerminateAction(Runnable action) {
		if (actionTerminate != null) {
			removeLocalAction(actionTerminate);
		}
		if (action != null) {
			actionTerminate = new ActionBuilder("Terminate", plugin.getName())
					.menuIcon(new GIcon("icon.plugin.terminal.terminate"))
					.menuPath("Terminate")
					.menuGroup("Terminate")
					.helpLocation(new HelpLocation(helpPlugin.getName(), "terminate"))
					.enabledWhen(ctx -> true)
					.onAction(ctx -> action.run())
					.buildAndInstallLocal(this);
		}
	}
Notify the provider that the terminal's session has terminated

<p>
The title and sub title are adjusted and all terminal listeners are removed. If/when the
window is closed, it is removed from the tool.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/terminal/TerminalProvider.java