logoalt Hacker News

queserayesterday at 9:23 PM1 replyview on HN

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)


Replies

VerifiedReportsyesterday at 9:43 PM

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