Terminal › Confirm On Exit

When you enabled Terminal › Confirm On Exit, VS Code will ask for confirmation before closing windows with integrated terminals. This can save you from losing important terminal sessions.

You can use "hasChildProcesses" to only be prompted if the terminal has spawned a child process, such as a watch task.