Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hello I am trying to go begining of the line. neither left arrow key or ctrl + a lets me do it. everytime it keeps couple letters on the right. however its a visual bug my cursor is actually in the begining

I am not exactly sure why it happens but it happen both on default terminal app and iterm2

enter image description here

enter image description here

P.S : it isnt only happens with this command I just didnt know what else to write to show.

share|improve this question
up vote 1 down vote accepted

That issue is related to your $PS1, you're probably missing some escape character. This one should work:

PS1="\[\e[1;31m\]\u[\w]$\[\e[0m\] "

share|improve this answer

Your Answer


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.