I've started using emacs a few days ago, and I'm facing a problem when using git in the emacs shell (M-x shell). When I 'git commit' or 'git commit --amend', it opens vim to edit and save the commit message. I'm ok with that, but I can't find a way to save and exit vim, since hitting ESC does not trigger vim Normal Mode, and ESC is my emacs metakey.
I tryed changing my git editor to emacs, but it doesn't work either, it seems like emacs shell cannot run emacs, and it doesn't open a new buffer like I thought it would.
emacs: Terminal type "dumb" is not powerful enough to run Emacs.
Posting the answer from @romainl in comment since it does what I want:
<C-o> to get out of insert mode,
:x and Enter.