D closes an
iterm2 window. Where's this option to disable it? I can't find it in
Control-D is EOF (End of file). Sending end of file to a shell session usually closes the shell.
You can set IGNOREEOF to force the user to type