Answer related to Powershell.
In case <esc> does not move from insert to normal mode, remap the following to something your shell/terminal won't complain about;
<esc>
<C-\><C-n> <C-w>N
<C-\><C-n>
<C-w>N
(taken from here)