In windows terminal navigate to Settings > Defaults > Advanced > Profile termination behavior
and set it to "Never close automatically"