Added iterm_profile config. Also fixed a problem when iTerm is running but has no terminals.