Software that takes text input should interpret that as the end of the input.
Shells decide that end of input means it's time to exit. Terminals usually decide that if the shell exits, there's nothing else to do and so close the window.
macOS Terminal.app instead prints "Process exited", which I can't quite fathom the value of. I guess it's marginally less confusing than making the window disappear. :)
(Note though -- I can't find it in Terminal.app settings right now, but there must be a way to change the behaviour to close the window instead. Mine is configured that way, but it's not the default)
Ctrl+D is the ASCII End Of File (EOF) marker.
Software that takes text input should interpret that as the end of the input.
Shells decide that end of input means it's time to exit. Terminals usually decide that if the shell exits, there's nothing else to do and so close the window.
macOS Terminal.app instead prints "Process exited", which I can't quite fathom the value of. I guess it's marginally less confusing than making the window disappear. :)
(Note though -- I can't find it in Terminal.app settings right now, but there must be a way to change the behaviour to close the window instead. Mine is configured that way, but it's not the default)