Preference "Quit when all windows are closed" is sometimes reset to off.
Thanks for filing an issue! Please answer the questions below so I can help you.
iTerm2 version: 3.1.4.beta.1 OS version: 10.13
I prefer to have iTerm2 quit when I have closed all terminal windows. Normally this setting works fine. But, occasionally, I will close the last window and notice that iTerm2 is still running. I go to Preferences and the "Quit when all windows are closed" preference will be unticked.
I then tick it and close the Preferences window. iTerm2 immediately quits. If I run iTerm2 again the preference is still ticked. And will work correctly for some time. But eventually, I will experience the problem again. I typically run with several tabs and with split windows. Sorry that I cannot find a way to reproduce this consistently.
I was not seeing this problem until the most recent iTerm2 update.