Terminal Project removal
Background processes
Confirmed Project removal stops its background processes through their captured projectRef, even if the conversation has since selected another Project.
Interactive shells
Terminal declares provides.projectRemoval and registers an awaited registerProjectRemoved handler for interactive shells. The handler fences new opens, drains already-started preparation, closes the selected PTYs and awaits their channel.closed verdicts, including shells already dismissed from the dock. An unknown exit rejects cleanup; files must not be deleted until this hook succeeds. The hook never chooses or deletes filesystem paths.