Command-Tab sends Ctrl-O to iTerm2
I spend all day Command-tabbing between browser and iTerm2. This problem started for me a year ago but I couldn't reproduce it reliably. I still can't reproduce it reliably. But it happens often enough that it is a nuisance.
I am most often running vim via ssh+tmux in an iTerm2 tab. At some random time, when I command-tab from the browser back to iTerm2, vim will immediately report an error: "E349: No identifier under cursor". Trying "nano" to see what it does will prompt me for a filename, which tells me it is receiving the Control-O key combination when. Furthermore, vim will exit insert mode before sending the Control-O. So it apparently is receiving (at least) ESC, Control-O upon trying to focus back to iTerm2 with Command-Tab. This switching behavior will persist until the tab is closed.
The problem appears to be tab-specific in iTerm2. Closing the tab and opening a new one will work around the problem. Other existing tabs will not automatically be affected when this appears. No other applications seem to be receiving this key combination in the same way.
I am mostly Command-Tabbing between iTerm2 and Chrome. I have not seen this happen tabbing between other applications other than Chrome, but that is not part of my regular routine. It happens infrequently enough that it is hard to reproduce.
iTerm 2.1.1 OSX 10.10.4