I’m using iTerm2 2.1.1 on Yosemite. No tmux.
When iTerm loses focus (when switched to another application by Cmd-Tab or clicking another window), a
^[[O seems to be sent to the terminal. This causes a
^[[I^[[O to appear, or more frustrating, in Vim, this combination opens another small buffer.
Sample: Pressing Cmd-Tab several times after starting
% cat ^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I^[[O^[[I
This only happens on iTerm and not on Terminal.app. Also, it reproduces on bash or sh, so it doesn't seem to be a zsh issue. Some Googling suggested that this is a “focus” issue, but what is “focus” in the meanings of a terminal, and is there any way to disable or avoid this?