Added new terminal option to open in new window in iTerm. Current stable builds of iTerm always open new session in new tab and this option makes it possible to open session in new window.
Now after connection is closed session will close automatically.