exit insert mode when entering non-terminal window