Simply hit escape and enter the following command to fix:
If this doesn’t get you back to normal, you’ll have to exit your current SSH session and re-open the session in a new window.
This error happened to me after I mistakenly hit [command] + R when trying to redo instead of [control] + R.
While it was occurring, I was unable to move the cursor with the arrow keys. I could insert and add characters at the cursor spot, but nothing else really.