Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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??

share|improve this question

migrated from stackoverflow.com Dec 12 '12 at 11:14

This question came from our site for professional and enthusiast programmers.

1  
Seems like you use vi mode. Does this help? stackoverflow.com/questions/105721/… –  Evert Dec 11 '12 at 23:33
    
@Evert Thanks ESC, A is useful. But I'd rather not have to ESC or use a 3 key combo. I was on someone's terminal once and didn't have this issue –  jermel Dec 11 '12 at 23:41
2  
@jermel well, the other person whose terminal you used probably wasn't using vi mode. It's not an "issue", it's a preference. Maybe you set it by mistake? Check your ~/.inputrc. –  Celada Dec 12 '12 at 1:21
    
@Celada thanks!! sigh... that was my problem –  jermel Dec 12 '12 at 1:29
    
@Celada well done, could you post your comment as an answer so the question can be marked as answered please? –  terdon Dec 12 '12 at 13:25
add comment

1 Answer

up vote 2 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.