Thanks. It exists, and I found that I already have it active. In Settings, it's under Profiles / Shell and the control is
When the shell exits: - Close if the shell existed cleanly