unix move cursor after last character

Posted on

QUESTION :

After I use my arrow key to move my cursor left, I am unable to move it back to the end of the line. For instance:

If I type:

$ echo hello wordl_ 

Then if I move the cursor left to fix typo

$ echo hello wor_l

I am unable to move the cursor back to the end of the line and the "l" will remain. So I then have to enter vi mode ESC,right, a to get to the end of the line. I am on a mac and bash is my shell.

Does anyone know what is causing this and how to fix it?

Am I the only one who has this problem??

ANSWER :

This is a feature of using vi key bindings set -o vi. To solve my problem I switched to emacs key bindings

$ set -o emacs

Leave a Reply

Your email address will not be published. Required fields are marked *